There are two kinds of prepositional phrases: adjective phrases and adverb phrases.
An adjective phrase modifies a noun or pronoun. It always comes immediately after the noun or pronoun it modifies:
Joe is the student with the highest grade. ("with the highest grade" modifies "student.")
An adverb phrase modifies a verb, adjective, or adverb. It is used to tell when, where, how, or to what extent about the word it modifies:
Megan put her bird in its cage. ("in its cage" modifies the verb "put.")