The iPhone offers additional security to keep data safe if your device is stolen.
Go to Settings, then Touch ID & Passcode or Face ID & Passcode. Turn on Erase Data at the bottom of the menu. If someone tries to guess your passcode, all data on the device will be erased after ten unsuccessful attempts. This is a great way to ensure that potential thieves can’t access your personal data if they steal your iPhone.
Just make sure you don’t let a small child get hold of your device and bash buttons randomly on the Lock screen, or you may find all your data gone!