Ground vias on high speed PCBs
This is my understanding, based on very little knowledge:

The the return current for the high speed part of the signal will take the path of least inductance. This means travelling along whichever plane is closest to the track. (In fact, it will travel on the side of that plane closest to the track).

When your signal track moves from the top layer to the bottom layer, the return current will want to move from one plane to the other (whichever is closest to the track). If these were both ground planes, then your second image would be fine. You can simply connect the two planes together with a via. But in your third image, you can't connect the two planes together with a via, because this is a short circuit.

If only there was some way to allow the high speed part of the return current to move from one plane to the other, without shorting out those planes. If only there was a component which conducted high speed signals, but blocked DC current.

Oh wait, there is. It's a capacitor!

The return current will flow along one plane, then, when the signal track changes layer, the return current will come up one via, through the capacitor, down the other via, into the other plane, and continue following the track.

In fact, this is exactly what the diagram shows in the yellow arrows.