If you restore to factory settings only - then yes - you will lose everything on the iPad.
If you restore the iOS and then restore from a backup after that and sync with iTunes - you will not lose anything. If you restore from an iCloud backup - and you only use iCloud - you will not lose anything in either.
This explains about restoring the iOS software on your device.
How to backup and restore from a backup
See step 5 in the article that I posted above.
I talks about restoring from your backup at the end of the iOS restore process. If you backup the iPad first, you can restore the iPad from that backup when you are done restoring the iOS. Read the article from the link in step 5 before you restore the iPad.
5. If needed, restore your device from a previous backup.