The pill is one element. It never gets created or destroyed; it just slides and resizes to sit under whichever tab is active.
Because the same element moves, your eye tracks it across the gap. Continuity tells you the new tab and the old tab are part of one surface.
Compare this to four separate highlights blinking on and off. That version teleports. This one moves, and movement is what reads as “same thing, new place.”
This is the heart of “shared element” or “magic move” animation. One element, animated between states, doing the work of explaining a transition.