The lump sum that you pay for your room (known as the Refundable Accommodation Deposit or RAD) comes back to your estate when you pass away.
If you have paid a lump sum for your room in a residential care facility, you give up access to this money whilst you are in care, but these funds remain part of your estate which can be left to your beneficiaries. The full amount is refundable (unless you have allowed any ongoing care fees to be deducted instead of paying these costs via your bank account).