These article have details:
Use Lost Mode in Find My iPhone on iCloud.com - https://support.apple.com/guide/icloud/use-lost-mode-mmfc0f0165/icloud
Use the Find My app to locate a missing device or item - https://support.apple.com/HT210515
"What happens if you activate Mark As Lost
Mark as Lost remotely locks your missing iPhone, iPad, iPod touch, or Mac with a passcode, keeping your information secure even if your device goes missing. You can also display a custom message with your phone number on the Lock screen, and keep track of your device's location.
Once Mark as Lost is activated, Apple Pay is disabled, if you have it set up on the device. A confirmation email is sent to the primary email address associated with your Apple ID. When you recover your device, you will need to unlock it with your passcode."
It can't be factory reset without information the user won't have.