The guaranteed rate on your equity is 0%. Got $500,000 in equity? Then that's $500,000 earning 0% interest. Of course you aren't paying mortgage interest but with mortgage rates at 3.5 - 4.25% it's easy to find investments with higher guaranteed returns.
Infinite Banking (using overfunded, dividend paying, whole life insurance) currently has 4.5% guaranteed floors with actual rates with dividends currently at 5.0 - 5.5%. Lots of other benefits as well, life insurance, and being able to borrow money against your policy any time you want for any reason, no questions asked.
Also, a 4% mortgage is only 4% of the whole balance in the beginning. At the end it is 4% of a very small balance. If you use level payments you effectively cut the interest rate in half to make comparison.
Taking out a $10,000 loan at 5% and investing it at 5% results in a profit.
Year 1 - Make a $1000 payment, $9000 balance (5% is $450). Your investment is $10000 at 5% or $500. $9000 loan and $10,500 in investments.
Year 2 - Make a $1000 payment, $8450 balance (5% is $423).
Your investment is $10,500 at 5% $525. $8450 loan and $11,025 in investments.
Your math is wrong. The loan balance isn't reduced by the entire payment, the interest is subtracted first. And it's on the beginning balance, not the end balance. At one time there were progressive payment loans where the balance actually went up the first few years, because the payment didn't cover the entire interest.
Year 1 - Make a $1000 payment, lose $500 interest for a $9500 balance. Your investment yields $500 interest, but you had to withdraw $1000 to make the payment, so you're at $9500.
Year 2 - Make a $1000 payment, lose $475 interest for a $8975 balance. Your investment yields $475 interest, minus the $1000 withdrawal leaves you with $8975.
And so it goes, down to the end. Compound interest works both ways.
Remember what I said above: somebody thought that investing in your mortgage was the best return they could get. Are you willing to bet against them?
You can apply the interest before or after the payment, it doesn't really make that much difference, especially when you pay monthly and it compounds daily. The more often it compounds the less of a difference it makes between interest computed before or after the payment.
It's simpler and more accurate to say that the interest is added to the loan balance and then payments are subtracted. They don't subtract interest from payments, they add it to the balance. Extra payments don't have any interest applied to them, they go straight to principal.
The comparison though is between paying your extra cash flow towards a mortgage or investing it. You don't take money from the investment to pay the mortgage. You pay the minimum to the mortgage and then invest the difference.
As far as why banks want to do loans, you have to understand how banks work. What banks do is different.
Banks take money from deposits and then loan that out. They pay 1% interest on saving account deposits and charge 4% on loans. They are effectively purchasing something at $1 to sell for $4. That's a huge markup (400%). Of course banks want to do loans. They also have fractional reserve working in their favor. They can loan out more money than they actually have in deposits because the money is created out of thin air.
This is the same model used by savvy investors. They make investments using Other People's Money™.
OK, have it your way. Here's a spreadsheet to compare a loan+investment with simply saving the payments. I changed the payment from a nice round $1000 to $1010.24 so that the loan would be paid off in exactly 14 periods. On the left, you see the investment grow while the loan is paid down. On the right, you see an account grow as you add $1010.24 to it each time and collect 5% interest on the balance. They reach the same value at the end.
As for the origin of mortgage money, you're forgetting about the secondary market. Lots of loans originated by banks get bundled up and sold off. That's a very lucrative business for some banks, because they can collect fees for the origination and get their money back right away with no risk.
Infinite Banking (using overfunded, dividend paying, whole life insurance) currently has 4.5% guaranteed floors with actual rates with dividends currently at 5.0 - 5.5%. Lots of other benefits as well, life insurance, and being able to borrow money against your policy any time you want for any reason, no questions asked.
Also, a 4% mortgage is only 4% of the whole balance in the beginning. At the end it is 4% of a very small balance. If you use level payments you effectively cut the interest rate in half to make comparison.
Taking out a $10,000 loan at 5% and investing it at 5% results in a profit.
Year 1 - Make a $1000 payment, $9000 balance (5% is $450). Your investment is $10000 at 5% or $500. $9000 loan and $10,500 in investments.
Year 2 - Make a $1000 payment, $8450 balance (5% is $423). Your investment is $10,500 at 5% $525. $8450 loan and $11,025 in investments.
...