What Apple says
"If you connect headphones to your iPhone, the alarm plays at a set volume through the built-in speakers on your iPhone as well as wired and wireless headphones" (Apple Support). The volume is fixed in that case, so the slider you use for music does not change it.
Sleeping with AirPods: what to watch
- Earbuds out of your ears but connected (on the pillow, in the case with the lid open): part of the sound goes there. Put them back in the case and close it.
- A Bluetooth speaker in another room can take the audio too; disconnect it at night.
- Battery: AirPods that die overnight disconnect; the speaker still rings.
- Test: set an alarm 2 minutes ahead with the AirPods in, then with them in the case.
If the alarm sounds faint in general, see why the iPhone alarm is quiet even with the volume up.
When the speaker has to do the work
Sunrise has its own loud sounds for heavy sleepers, from gentle chimes up, with volume that ramps up gradually, and it stops only after a math or steps mission.