Basically, at the last corner, Hamilton was 6th, Massa won. This means that Massa was to win the WDC.
However, Glock was very slow, and span or skidded, or whatever. Hamilton passed him on what was basically the last 500 yards of track, to take 5th place and the WDC.
The Ferrari crew were cheering, until they noticed their monitors which obviously showed Hamilton finishing in 5th.