A locked phone keeps everything in
A modern phone is well protected. That is good while you are alive. After a death, the same protection works against your loved ones. Without the PIN, password or pattern they cannot reach the photos, the videos, the messages or the apps.
Next of kin are often advised to simply reset the device. That permanently wipes everything that was only on the phone. And a recent device often still cannot be used after a reset without the account details of the previous owner.