No, the bank does not take the house when the borrower dies, and no one has to pay off the mortgage in a lump sum. The debt does not vanish either. It stays with the house. Whoever inherits the home can usually keep making the same monthly payments, on the same terms, and keep the house. Federal law protects that right.
A mortgage is a loan secured by the property. When the borrower dies, the loan is still owed, but the death itself does not make it due. As long as the payments keep coming, the lender generally cannot demand the full balance or start foreclosure. The people who inherit the house get real choices: keep it and continue the payments, refinance, or sell it and take whatever equity is left after the loan is paid off. Reverse mortgages work differently, and this guide covers that separately at the end. For the broader question of what happens to money owed after a death, see what happens to debt when you die.