Actually, PAN PAN PAN is not an emergency but requires serious attention but it is a level lower.
SOS of course is only using cw but requires far less power to be heard vs say SSB (voice). Been a ham for 57 years WØJKT and ships in International waters often want licensed hams and HF gear since we can bounce signals off the ionosphere thousands of miles vs the short mostly line-of-sight frequencies the Coast Guard uses or on the "guard" emergency channel of ships and aircraft. There are hams and equipment on the International Space Station which we can talk with but it's also the last resort for emergency communications if their telemetry and normal coms go down which are basically line of site on VHF/UHF.
In the US "mayday., mayday, mayday" is no longer the accepted plain language terminology now required for airplanes, although it still is in Europe and for amateur radio. The proper airline declaration in the US is "I declare an emergency". All sorts of things happen with ATC, the radar screen shows EM, controllers will clear all traffic around you to get out of the way. The controller will ask the nature of the emergency, fuel, and souls on board.
Depending on fuel and nature of the emergency if not immediate may need to dump fuel first to get to a safe landing weight- especially if just took off. A fire in an engine is usually not a direct immediate return since most fires can be extinguished with the usual one of the 3 bottles that can be fired. Planes can fly on one engine - it will still be an emergency but if over landing weight will usually dump fuel. Likewise, if landing gear won't go down etc.
I listen to many of the ATC emergencies recorded. They happen more often than you would like to think but most end safely.
One of my favorites was the young girl on her first solo flight who was informed she lost a wheel on takeoff (small plane). The controller (woman) now knowing how young and inexperienced she was said the usual, "state intentions" She replied in a weak scary voice "can I return to the airport?" She had plenty of fuel and ATC was able to contact her instructor who calmly assured her all was well and another chase plane went up to try and guide her in. It is very difficult to land when one of your side wheels is gone- especially to keep on runway as land. She crashed off the runway but was unhurt.
And of course, there was the SW airline where the female pilot declared an emergency mentioning "we have lost a passenger out the window." The controller said. "What??...never mind" and just went into emergency proceedings.
There was another incident where a bird smashed the window and the pilot was sucked out but was able to hang on as the pilot dove down so he would have enough oxygen. Amazingly he survived.
I recall hearing a few incidents at the Toronto airport including the big crash a few years ago spilling onto the highway.
BTW I enjoyed being in a 737 cockpit (actual out-of-service 737) doing a flight simulation at the Flight place on the Northside of Toronto Airport. It was so real after we landed somewhere in NY I actually thought for a moment we still have to fly back to Toronto...ah... no just open the door.