This fee is a cost to the borrower for the option of repaying a loan early. It can also be called “call protection” because it puts a price on the option that a borrower has to “call” or prepay a loan.
Lenders are of two minds regarding prepayments:
On the one hand, a full early repayment means that a loan is 100% safe which is always a good thing;
On the other hand, the lender now has to find a new borrower for the capital that it likes as much as the one which just repaid.
Sometimes in the lending business it can feel like the best companies repay early. This isn’t always the case but there is some truth to it and when a great company repays it loan it can be difficult to replace it with another great company.