A preposition is a small word like in or to that names how a noun relates to the rest of the sentence, usually in terms of place, time, or direction. It typically comes before the noun or pronoun it links to.
Two quick examples
In the book on the table, the little word on connects book to table. It tells you where the book sits, linking the two nouns in one picture.
Look at to the moon: the word to points a direction, away from here and toward the moon. In this little phrase, to is the preposition, and the moon is its object, the noun that to points to. Together they form what is called a prepositional phrase.
One nearby term
A helpful way to picture it: on by itself is a preposition, and when a noun follows it, the two words work together. In on the table, the preposition on combines with the noun the table, and the pair is called a prepositional phrase. The noun after the preposition is called its object, so the table is the object of on.