There no rule that the mortgage will run for 30 years. It’s just what most people choose. But there’s nothing stopping anyone from paying back the entire mortgage in 10 years.
I can't find all the fine details on this loan, but there are definitely loans that stop you from prepayment, or at least have a penalty associated with them. These penalties can be pretty large and definitely are a reason not to pay back the entire mortgage before 10 years. In this exceptional case I'm assuming there is a prepayment penalty for a large portion of that 10 year fixed rate period.
The discussion is about 10-year fixed rates. After 10 years you can either refinance or pay (and it’s not an anticipated payment), or maybe it’s already stipulated that the rate after 10-years is floating (but then cancellation is also much easier than in the middle of a fixed-rate mortgage).
Those prepayment fines are basically what the bank is losing out on you. If you have a 3% mortgage and the current rate is 2%, then the bank would lose out 1% for the current mortgage period. That's the penalty.
That is not how the penalties are worded at all. Penalties are usually in the form of a percentage of a number of months' interest. I understand the fine is because the bank makes money on loans by being able to rely on them being a fixed long term, and the cancellation affects that, but it's not just the bank passing on that percentage loss directly.
Perhaps it's a country thing. Here in the Netherlands that is how the banks calculate the prepayment fine. You are allowed to pay off 10% to 20% of the original sum per year but over that amount you pay a "boeterente" (interest-fine). It's equal to the amount of money the bank loses by loaning your money to someone else over the remainder of the fixed period (10/20/30 years).
They are specified in the contract. If you sign the mortgage contract you are giving the bank steady business for the next 10 years in return of a lower rate. By breaking that 10 year agreement the bank loses money which they will charge you for.
Apart from not having the money.