This also can be explained as different roles, which an object can play in a sentence, so-called cases of the object. In german there are 4 different cases:
1. Ich, du,... - is like "I, you", which usually plays the role of the subject in a sentence, who is doing the action.
2. Mich, dich,.... The direct object on which the action is done (like "me, you, him,..." in english)
3. Mir, dir,.... The indirect object, who benefits from the action, for whom the actions is being done.
Examples:
Ich sehe dich. I see you. Ich - the subject, dich- direct object
Du siehst mich. Try to explain this.
But "Ich gebe dir etwas(something)". I give you something. Here "Ich" - subject, "etwas" - the thing on which the action is being done and "dir" the indirect object, who benefits from the action.