Here's why:
* Prepositions connect nouns or pronouns to other words in the sentence. In this case, the preposition is "in".
* Prepositional phrases consist of the preposition and its object, which is usually a noun or pronoun. The object of the preposition "in" is "the gentle wind".
The phrase tells us where the trees swayed.