1. She looked at the person on the table.(When the person is on the table, 'on the table' is an adjective phrase.)

2. She looked at the person on the table.(When she is on the table, 'on the table' is an adverbial phrase.) (How can we distinguish the two situation? According to the situation, the part of speech of 'on the table' is different.)

Both sentences mean the same. The person is on the table -- so the phrase is an adjective phrase.

However, -- the same phrase is an adverb phrase in this sentence.

She left the book on the table.

A prepositional phrase usually is right after the word it modifies.

In order to distinguish between the two situations in the sentences you provided, we need to understand the role of the phrase "on the table" in each case.

1. She looked at the person on the table. (When the person is on the table, 'on the table' is an adjective phrase.)
In this sentence, the phrase "on the table" is functioning as an adjective phrase. It describes the location of the person she is looking at. In this case, "on the table" tells us where the person is positioned.

2. She looked at the person on the table. (When she is on the table, 'on the table' is an adverbial phrase.)
In this sentence, the phrase "on the table" is functioning as an adverbial phrase. It describes the manner or circumstance of how she is looking. In this case, "on the table" tells us how she is positioned while looking at the person.

To distinguish the two situations, we need to analyze the structure and context of the sentence. The first sentence suggests that the person is physically located on the table, while the second sentence suggests that the person is in a different position and the speaker is on the table while looking at them.

To identify the function of a phrase in a sentence, it can be helpful to examine the context, the role it plays or the grammatical role it fulfills. Additionally, understanding the meaning and usage of different parts of speech can aid in distinguishing between various sentence structures.