Hello Wolfer,
Prepayment penalties only apply if you want to make repayments or full loan repayments earlier than the term agreed in your loan contract.
So, if you have agreed on a 10-year fixed interest period (and no special repayments were fixed in the loan contract) and want to repay, for example, after the first three years, the bank will usually only allow this after payment of a prepayment penalty.
This is to compensate for the interest loss that the bank incurs. Banks refinance themselves and also pay interest for the money that has been lent to you.
If the interest payments from you cease, the bank suffers an interest loss.
Best regards
M. Thiemann