Looking around the shooting blogs and forums, the incident I witnessed yesterday happens rarely, but it does happen enough that the USPSA rulebook specifically addresses it.
10.4.3.1 Exception – a detonation, which occurs while unloading a handgun, is not considered a shot or discharge subject to a match disqualification, however, Rule 5.1.6 may apply.
As the live round is being extracted, the round comes off the extractor. If it is moving fast enough, and the primer strikes the ejector, it can detonate.
Here’s a couple of write ups.
Catching Your Round At “Unload and Show Clear”
And from the Brian Enos forum, a long thread on the topic.
At the “unload and show clear” stage of things, some shooters try to catch or capture the round. I had been told not to do this, as this was a bad idea, now I know why. If you had your hand covering the ejection port when this happened, the injury could be serious.
As it is, I am going to reevaluate how I hold the gun and pull the slide when showing clear.