Assume that a pit stop (under green) takes the equivalent of 22 seconds on track (some are faster, some are slower). That just means that the leader needs that much of a lead. I see three general classes where you can pit without losing the lead:
- The leader has gained the full green pitstop delta on the field and can freely pit under green.
- The leader has gained a portion of the full pitstop delta, but is able to pit under a slow track (safety car or virtual safety car).
- All the near competitors pit before the leader (perhaps trying for the undercut), leaving the leader well clear.
I believe the most recent slam was Verstappen in the 2021 Austrian Grand Prix. This is an example of the third case (and maybe a bit of the first as well).
After the racing got going, only Bottas and Hamilton were close to Verstappen. They pitted on laps 30 and 31, leaving Verstappen clear to pit on lap 32 while keeping the lead.
Later, Bottas had not pitted again, but Verstappen had pulled well clear. He had plenty of time to change tires on lap 60 without being challenged for the lead.
The F1 drivers with the most races where they led every lap (as per Autosport) are:
- Lewis Hamilton: 23
- Ayrton Senna: 19
- Sebastian Vettel: 15
- Jim Clark: 13
- Jackie Stewart and Michael Schumacher: 11