A preposition describes a relationship between other words in a sentence. In itself, a word like "in" or "after" is rather meaningless and hard to define in mere words. For instance, when you do try to define a preposition like "in" or "between" or "on," you invariably use your hands to show how something is situated in relationship to something else. Prepositions are nearly always combined with other words in structures called prepositional phrases. Prepositional phrases can be made up of a million different words, but they tend to be built the same: a preposition followed by a determinerand an adjective or two, followed by a pronoun or noun (called theobjectof the preposition). This whole phrase, in turn, takes on a modifying role, acting as an adjectiveor an adverb, locating something in time and space, modifying a noun, or telling when or where or under what conditions something happened.
Consider the professor's desk and all the prepositional phrases we can use while talking about it.
You can sitbeforethe desk (orin front ofthe desk). The professor can sitonthe desk (when he's being informal) orbehindthe desk, and then his feet areunderthe desk orbeneaththe desk. He can standbesidethe desk (meaningnext tothe desk),beforethe desk,betweenthe desk and you, or evenonthe desk (if he's really strange). If he's clumsy, he can bumpintothe desk or try to walkthroughthe desk (and stuff would falloffthe desk). Passing his handsoverthe desk or resting his elbowsuponthe desk, he often looksacrossthe desk and speaksofthe desk orconcerningthe desk as if there were nothing elselikethe desk. Because he thinks of nothingexceptthe desk, sometimes you wonderaboutthe desk, what'sinthe desk, what he paidforthe desk, and if he could livewithoutthe desk. You can walktowardthe desk,tothe desk,aroundthe desk,bythe desk, and evenpastthe desk while he sitsatthe desk or leansagainstthe desk.
All of this happens, of course, in time:duringthe class,beforethe class,untilthe class,throughoutthe class,afterthe class, etc. And the professor can sit therein a bad mood