[subject] + [verb] + 给 + [person] + [object]
[subject] + 把 + [object] + [verb] + 给 + [person]
[object] + 是 + [verb] + 给 + [person] + 的
A verb that hands something over – 送 "give as a present", 借 "lend", 还 "return", 交 "hand in", 寄 "post" – takes 给 right after it, then the person who receives, then the thing.
When the thing is already known, 把 brings it before the verb and 给 + person ends the sentence.
The verb and 给 work as a unit, so 了 follows 给, not the verb.
Before the verb, 给 + person usually means "for" someone: 我给他买了一本书 "I bought a book for him", which doesn't say he has it yet. After the verb, 给 says the thing reached him.
借 is both "lend" and "borrow"; the direction is in the sentence. 借给 + person is "lend to"; 跟 + person + 借 is "borrow from".