A boxcar moves with uniform velocity, and two lightning bolts strikes its ends, leaving marks (A’ and B’ on boxcar and A and B on ground). An observer at O’ moving with the boxcar is midway between A’ and B’ and an observer on the ground at O is midway between A and B. The events recorded by the observers are the striking of the boxcar by the two lightning bolts.
The light signals recording the instant at which the two bolts struck reach observer O at the same time. This observer realizes that the signals have traveled at the same speed over equal distances, and so concludes that event A and B occurred simultaneously. Now consider the same event as viewed by observer O’. By the time the signals have reached O, O’ has moved. Thus, the signal from B’ has already swept past O’, but the signal from A’ has not yet reached O’. O’ sees the signal from B’ before seeing the signal from A’. According to Einstein, the two observers must find that light travels at the same speed. Therefore, observer O’ concludes that the lightning struck the front before it struck the back. This thought experiment clearly demonstrates that the two events that appear to be simultaneous to observer O do not appear to be simultaneous to observer O’. They are both right even though they have different conclusions.
Two events that are simultaneous in one reference frame are in general not simultaneous in a second frame moving relative to the first. Simultaneity is not an absolute concept but rather one that depends on the state of motion of the observer.
Video explaining simultaneity: