A lender never (intentionally) gives anyone anything for "free". This is why ARMs often have lower interest rates than fixed 30 year mortgages - the risk to the lender from rising interest rates is lower with ARMs so lenders generally accept a lower interest rate on ARMs.
Both sides are making a bet on future interest rates and alternative investment returns - with one (the borrower) paying extra for an "opt out early" option for which the lender assumes the risk.
It's a bit like the borrower is buying a long term put or call option from the lender which the borrower is free to exercise at any time or to let expire but the lender can't get out of (they, of course, can always sell the mortgage - but perhaps at a loss in some economic climates due to past and expected future interest rate declines and/or changes in default risk due, for example, to a recession or depression).