To answer your question properly would take a lot of writing!
It is used in several forms, and in each of those forms, particularly as a preposition, it can have many different meanings.
Wiktionary has a good summary: https://en.wiktionary.org/wiki/to#English