Why does a driver in (say) 13 place have a checkered flag but positions 4-12 have no flag yet?
The reason for that is simple.
The race is over for any car crossing the finish line line after the winner and they cross the line in the order of cars on the track, which isn't necessarily the order on the scoreboard due to lapping of slow cars.
For example, if a slower car was lapped and is now between the first and second placed cars they will finish the race "together". The winner sees the chequered flag and so do all the following cars, regardless of how many laps they're behind. They will not be able to unlap those laps anymore and get ranked accordingly.
This link on the BBC to Formula 1 Flags explains that the chequered flag is show to the race winner and every car behind them. The race is complete for those cars once the chequered flag is shown to them.