Last night my son complained that our iPad's sound stopped working. When I took a look, I realized that when I tried to change the volume, the volume bar always said "Headphones" despite having no headphones plugged in. The Airplay sound destination also only showed headphones as an option.
Oddly, when I used the Settings app to adjust the ringer volume, the ringtone played out of the speakers. But then pressing the volume up and down keys still registered "Headphones".
This typically means that something is causing the physical headphone audio jack to register as if there were headphones plugged in to the jack. Here are the things I recommend trying first if the iPad volume says headphones but no headphones are plugged in:
Plug in headphones and then unplug them. I've had this fix the phantom headphones issue on an old iPhone.
Reboot the iPhone/iPad.
Using a (wooden) toothpick or compressed air, ensure there is nothing lodged in the headphone jack. Please be gentle and go slowly if using a wooden toothpick.
Put the iPhone/iPad in a Ziplock bag with a few desiccant packets (or some rice) to get rid of some excess moisture.
Last night I even factory reset the iPad, but it still didn't help (so I do NOT recommend that). I ended up putting the iPad into a Ziplock bag with some desiccant/silica gel packets and in the morning the issue was resolved. I'm assuming that sometime in the past 24 hours, one of my two boys had a minor spill on the iPad :) and even though it was cleaned up, some excess moisture remained in the headphone jack.