This is really very easy to replicate.
1. Unlock your iPhone
2. Make sure your phone is NOT on silent
3. Open Control centre, put your volume all the way up
4. Open Settings > Sounds, put your Ringer/Alert volume all the way up
5. Turn off "Change with buttons"
6. Connect your AirPods and put them in your ears
7. Play a YouTube or Instagram video or something, adjust volume with the buttons on the side of your phone so that it's comfortable. Even make a phone call or listen to music at an appropriate/comfortable volume.
8. Turn off music/videos and close your apps
8. Put your phone in your pocket
10. When you receive a phone call or a text message, the ring or notification will be at full volume and will blow your head off
It's very user unfriendly and seems like a mistake to me.
Because if you don't want this to happen, you have to go into Settings > Sounds and turn the ringer/alert volume down. But if you forget you have done this, then when you put your AirPods away and your phone rings the ringer is going to be very quiet and too bad if your phone is in another room or something - you won't hear it.
It means every time you connect or disconnect your AirPods you have to remember to also change the ringer and alert volume, or else risk bursting an ear drum (with AirPods in) or missing a phone call/text (when you put the AirPods away).
Now complete the above steps again, but this time plug in Apple's standard cord headphones. You'll notice a different result in terms of notification volume.