When one gives or receives an action(i.e., to do something for someone or to have someone do something), the action is expressed using a verb in the te-form, which is followed by a verb of giving or receiving(e.g., あげる, もらう, くれる). These expressions are used to talk about the giving and receiving of favors/benefits.
わたしは友だちに国の料理を作ってあげました。
I cooked some dishes from my country for my friends.
わたしは妹をほめてやりました。
I praised my younger sister.
友だちはわたしに写真を見せてくれました。
My friend showed me a photograph.
先生はわたしに本をかしてくださいました。
My teacher kindly lent me a book.
わたしは友だちに写真を見せてもらいました。
I had my friend show me some photographs.
わたしは先生に本をかしていただきました。
I had my teacher lend me a book.