The first thing to know is that there really is no "lender" in the traditional sense.
The first form of banks we had we had had depositors deposit money for safekeeping. Banks would then lend that money out to earn interest. We then basically decided this was too conservative a strategy so we have fractional reserves, meaning if you have $100,000 in deposits you might be able to lend out $1 million. A lot of Crypto Andys see this as a problem. It's not, particularly because depositor funds are guaranteed by the government (up to a limit) in the US at least.
But in recent decades we say the rise of mortgage-backed securities ("MBS"). Banks will take those mortgages and package them into what are effective bonds and then sell them to the market. This is now completely off the bank's balance sheet so they're not even really the lender anymore. They're basically just the agent who collects the repayments that get packaged up and go to the MBS holder.
Non-payment of a mortgage will give the bank some options depending on your state but there are a lot of varying consumer protections here too (eg non-recourse states mean the bank can typically seize the property being the collateral for the loan or go after you for any outstanding debt but they can't do both).
But if the loan is underwater (meaning the loan value exceeds the asset value) the bank can only really do something if you stop making payments. There is meant to be due diligence here done by the banks to make sure the entire package of property being an MBS isn't underwater. Obviously this failed spectacularly in the subprime era.
But one house being underwater isn't generally a problem.