You need $300,000 for a house
If you have $300,000 you can just buy the house like you do anything else. One big lump payment and it's yours
But you don't have $300,000
So you go to someone that does. It could be anyone. A friend, a neighbor. A celebrity. Mr Beast. Probably the Bank though. And you say, "can you give me $300,000?"
If it's a friend or a celebrity or Mr Beast, maybe they just give you the money. You now have $300,000 and you can buy the house like you do anything else. Just give them the money and the house is yours
Probably you had to ask a bank
The bank does have $300,000 but it's not really their money. They're taking a few dollars from everyone who keeps money in their bank and they're investing it; they keep the profit and that's how banks make money (in simple terms). So the bank will say, "We will loan you $300,000 but you'll need to pay us back plus interest"
How much interest?
That depends on the government
You agree, or not, up to you. In this case, maybe you agree. The bank gives you $300,000. You buy the house. You own the house, except now you have to pay the bank back, plus interest, for the $300,000 loan they gave you
So while it is your house, the bank is holding on to the house so they can sell it in case you don't pay them back.
Remember, they didn't load you their money, they loaned you money that they took from everybody else bank account. If you default, other people lost money and the bank can't have that, so they'll sell your house to get that money back.
So you pay the bank, plus interest, per your agreement
This isn't crazy, it's how pretty much every loan works.
If you can pay off the house in 6 months, great. You didn't pay that much interest. Pay it off over 15 years, you paid a bit more interest. How much interest depends on the size of the loan, the interest rate, and how long you took to pay it back
This has been finance and loans 101