When a moving train suddenly stops, the passengers' bodies continue moving forward due to inertia - the tendency of objects in motion to stay in motion. This sudden deceleration causes the passengers to jerk forward relative to the train, creating the sensation of a shock. The law of inertia (Newton's first law) explains this phenomenon where a body maintains its state of motion unless acted upon by an external force.