I borrowed money from a friend.

Literal

Friend [from-に] money [object-を] borrowed.

借りる ('to borrow') takes に for the source — the person you borrow from. English says 'borrow from' but Japanese uses the same に that marks a giver or source in other constructions. A very common beginner-level pattern.