Factory reset will wipe the phone, but Pixels have a decent backup/restore system, so much of your information will be restored. It helps if you use Google apps to save a lot of your information (like Google Contacts, Google Drive, Google Keep, etc.)
If the battery level is fluctuating like that, I would suspect a failing battery even more. It's time to make sure your important data is backed up or synced somewhere safe, and start looking for a replacement phone before your current one stops powering on at all.