The rule for pacers is that they must start the race at the same time and be able to keep up with the runner being paced, though they don’t have to finish it. Swapping fresh legs in mid-race isn’t allowed.
In a college indoor track 5K, one of my teammates was being lapped by another teammate competing for a podium spot. The guy being lapped started sprinting to help the guy near the front of the race finish strong. That was ruled illegal pacing and they were both disqualified. It was a similar sort of situation — in order to legally pace you must be able to keep up with the runner your pacing.
It varies by event. Personal pacers in the marathon are uncommon to begin with. In ultramarathons they are specifically not allowed until late in the race. That a track event would rule that way had become an unfortunate expectation.
Pacers in ultras largely serve a different purpose. They’re there for safety, especially once it gets dark. In events 50 miles and shorter, pacers usually aren’t allowed. Sure, the elite runners could get some actual pacing at the end but that’s a very small portion of pacing in ultras.
In a college indoor track 5K, one of my teammates was being lapped by another teammate competing for a podium spot. The guy being lapped started sprinting to help the guy near the front of the race finish strong. That was ruled illegal pacing and they were both disqualified. It was a similar sort of situation — in order to legally pace you must be able to keep up with the runner your pacing.