Mortgage overpayments
Paying more than the contractual amount usually reduces interest and can shorten the term. It can also trigger a charge.
Interest is charged on what is left
Each month, interest is calculated on the opening balance. Anything left from the payment reduces the balance. An overpayment increases that reduction.
Comparing an overpayment with investing uses an investment assumption. The mortgage saving is contractual only for the rate you still have. The investment can fall. The comparison is not a recommendation.