if you don't hand over the private key to your wife and children, of course your bitcoins can't be taken by them, your bitcoins can be an inheritance for your children and your wife as long as you hand over the private key to them.
If you don't hand over the private key to anyone, the bitcoins or altcoins in your personal wallet will never be opened and transferred by anyone. Therefore it is necessary to give private keys to people we trust to manage crypto assets after we are gone. This is a legacy in the form of digital assets.