A factory reset will surely delete your data, it’s a feature of the reset.
But you can lose your data because of a hardware defect in any given next moment. With any computer tech.
That’s what you should be afraid of, and that’s why you make regular backups of all your important data (no backup = no important data).
A manual reinstall of the OS will not delete your data (say Fairphone, but even they recommend a backup).
If you need a real clean break, here’s how.