You want to sell your phone
Factory reset generally doesn't erase anything on a micro-SD card.
It doesn't in all cases exhaustively overwrite internal flash either. So it may be possible for determined people to recover your data (e.g. on a second-hand phone). This doesn't mean it is easy to do or 100% successful.
I believe since Android 4.3, a factory reset will attempt to more effectively wipe all data in the phone's internal storage.
Several sources advise using the phone's options to encrypt all data before doing a factory reset.
Some phones have a recovery mode accessed using VolumeDown+Power from which you can select "wipe data".
You didn't realise Factory Reset might make your data inaccessible
If you don't regularly back-up important data, you will eventually lose it. You should also back up data before performing any major operation like a factory reset on any device/computer.
See links above for data recovery.