If a person does die and they have a mortgage and someone else such as a spouse was listed on the mortgage along with the deceased person then the mortgage payments become a a requirement of the living person or spouse.
So the living person or living spouse would be responsible for making the mortgage payments after the person dies.
If no one else is on the mortgage or responsible for the mortgage then the persons assets and estate will pay for the mortgage but if there's nothing that can be sold to pay the mortgage then the bank will just foreclose on the mortgage and property and take the home or land back and then resell the property to get it's money back.
There's not much else a bank can do when a person dies since you can't force a dead person to pay the mortgage or take the dead person to court.
They'll just have to foreclose on the property and sell it to recollect the money they've lent out.