gk7ncklxlts99w1 Under what circumstances will data not be verified?
Android splits data into two parts.
The system partition is covered by verified boot and dm-verity, which detect if the contents of the system partition are changed by anything other than installing a new release.
The user data partition is expected to change over time as user profiles are created and deleted, apps are installed and deleted, and app data is created, edited, and deleted. The user data partition is not (ever) verified by verified boot or dm-verity.
The "factory reset" function securely erases the user data partition, so no apps or data remain, whether "good" or "bad", and the reboots before and after "factory reset" check that the system partition is intact. Thus at the moment of a "factory reset" everything on the system partition is verified and everything that is not verified, on the user partition, is gone.
If malicious apps or data are restored from a backup to the user partition then the device might be compromised again.