Have you heard of the 'love parade' festival tragedy? Honestly, I recommend you
don't look it up.
But what happened is there were lots and lots of people trying to get through an area / walkway. You massive crowds of people coming from all directions, all feeding into this walkway area, essentially creating a bottle neck.
So can you imagine, thousands of people continuing to fill up this area / get through, eventually there are going to be so many people that if you're in the middle area, they'll be people in front of you, behind you, in every direction around you, eventually it gets so bad that everyone is coming to a stop simply because of the people around them also not being able to move. Then the pressure gets more and more intense, those people around you are now pressed up against you. There's no way out, it's like this at least 800m in front and behind of you. You are literally getting squished to death.
At this point people are panicking. They're suffocating to death simply because the people around them are so densely packed, the pressure is crushing their ribs. I would guess at this point people would be trying to save their lives by pushing, trying to get above people, and as the crowd slowly moves forward and gets slightly less dense, people are going to do their best to get the hell out of there by any means, and at this point people start running.
The people that suffocated before are unconscious on the floor, with this panicked crowd just trampling over them. Some who fall will also be trampled.
The people that survived were most likely stronger physically, AND were standing in a position that protected their ribs. I've heard people who survived this stood in a kind of 'football stance' and rode the human compression wave.
Here is a video explaining what happened at the festival:
https://www.youtube.com/watch?v=8y73-7lFBNE
I have no idea what happened in Mecca, but I thought this might be relevant. I honestly never considered this as a potential way to get seriously injured or die, i.e. large crowds in non-open areas.