When a bus is in moving condition, every passenger has inertia of motion. While sudden brakes are applied, the downward part of the body becomes speed less but the upward part of body wants to continue moving. So the body of the passenger moves forward. So all of these for function of inertia.
See the function.
When you are in a bus that is moving, let's say 50mph, your body is also moving at exactly 50mph, but when the brakes are applied, the bus stops being at 50mph, and goes to 0mph, but we humans don't have brakes, so we are still at 50mph, but now the bus is at 0mph,
So therefore, we move forward.
If you didn't understand what I said in the end, I simplified it here:
When the brakes are applied, the bus goes from 50mph to 0mph, when the bus is at 0mph, our body can't give a sudden brake, it's like when you're running too fast that you can't stop at exactly the finishing line, you have to run a little more.
When the bus goes from 50mph to 0mph, we're still at 50mph, so it's like running on a road, but we have to tightly hold the bar because the bus suddenly goes from 50 mph to 0mph, but our bodies can't suddenly brake.