However, not every language has a verb that appears at the middle of the two nouns that one can tell which one is doing what to the other. Some languages have the verb at the very end of the sentence, like in Japanese for example. And some other languages have the verb right at the very beginning of the sentence, like in Tagalog and other Philippine languages.
So how do these languages mark who is doing what to whom?
Well, there is the concept of case. Case marking is the way languages mark the performers of an action. So, in Japanese, one have suffixes that can mark who is doing what to whom. The same sentence above in English can be said in two ways in Japanese.
1) John-ga Mary-o mikaketa.
2) Mary-o John-ga mikaketa.
The verb is the final word of the sentence, and as you can see, you can even switch things around, but they mean the same thing (well, technically there is a difference, but that leads to the realm of pragmatics, which I am not discussing right now). In both sentences, it is John who did the seeing.
In Tagalog, one can see the same thing.
3) Nakita ni Juan si Maria.
4) Nakita si Maria ni Juan.
Tagalog has these little words that appear before the nouns which in effect marks who is doing who. The verb appears at the beginning of the sentence, and you can scramble the nouns all you want, but you can still maintain that John did the seeing and Mary was the one he saw due to the case markers that are attached to the nouns.