Btc isn't totally anonymous and it's possible for someone else to take a peak if how many btc you have by just pasting your address in a site like blockchain explorer. Your family and friends can also tell if how much btc you have if you tell it to them or if they open your wallet.
Knowing that you have how many Bitcoin is different than having access to your Bitcoin.
If anyone knows your public address, they can type it on block explorers and check available balance. However if they want to access your Bitcoin, they must know either your wallet password or know your private key. If they know it, they have access to your Bitcoin and can use it for sending, trading, etc.
It's a big deal for some especially if they are holding large amounts but it will be a good idea to have a trusted person and lend them your backup keys so that they can be able to use your btc for good once you perish in this world unexpectedly.
First make your wallet backup correctly
Second store your backup safely and secretly
Lastly, make sure you tell someone you trust about that as a reserved solution when you suddenly pass away.
I think there are projects created on the past to solve this issue where our coins will be transferred automatically to an active address once there's no activity detected after a long time. I only forgot its name unfortunately but ill try to remember it or will search for it and maybe I'll attach it here.
Maybe this one
Using Locktime for inheritance planning, backups or gifts