Racing back to the caution

In automobile racing, specifically NASCAR stock car racing, racing back to the caution is a procedure for drivers after a caution flag is displayed.
NASCAR usage.
The procedure was used in NASCAR racing series when the pace car was deployed as a result of an on-track emergency such as a crash or rain. When NASCAR declared a caution period, racing would not cease immediately; rather, the drivers could continue racing for position until they crossed the start-finish line and received the caution flag. Passes for position counted, and drivers running a lap down (or more) were able to un-lap themselves if they passed the leader prior to the start/finish line.
In addition, if the yellow came out on the final lap, the race would continue until the cars crossed the finish line. An example of this is the 1987 Firecracker 400, when Ken Schrader wrecked approaching the tri-oval on the final lap. If the yellow came out very near the end of the race - so late in the race that there would not be sufficient time to clean up the incident and go back to green before the race had exhausted its scheduled distance - the race would effectively end as the cars received the yellow flag at the start/finish line. The remaining laps would be run under yellow (with no passing on the track allowed). An example of this would be the 1984 Firecracker 400.
After racing back to the caution was eliminated, the green-white-checkered rule was implemented to help avoid a race from finishing under caution, particularly in the middle of a lap. Though as of 2023 a race ends under caution with the field frozen if a caution occurs in the final lap of an overtime.
Problems with racing back to the caution.
Safety.
The practice sometimes created dangerous situations in which cars would be racing near wrecked cars, with possibly injured drivers, and prevent the safety team from reaching the stricken cars quickly. Also, there were numerous situations where cars racing back to the caution nearly, or in some cases did, become part of the crash by plowing into slow or stopped cars on the track.
Criticism of the rule first aired on CBS during the 1983 Daytona 500 following a bad crash by Darrell Waltrip when leader Dick Brooks slowed and the lapped car of Lake Speed chopped him off, forcing him hard on the brakes as Waltrip approached. Color analyst David Hobbs was sharply critical of the rule, and it was criticized in Sports Illustrated's coverage of the 500 by writer Sam Moses.
This especially showed during the 2003 Sylvania 300 at Loudon when Dale Jarrett had stopped in the middle of the track at the start finish line while the drivers were racing back to the flag. Another infamous incident took place in the 1990 ARCA race at Daytona, where cars slowing down under caution crashed into a stationary car being attended to by rescue crews after a multi-car crash, seriously injuring a paramedic.
Competition.
In addition, many drivers felt there was an unwritten "gentleman's agreement" about not racing back to the yellow during the early portions of the race. Many drivers felt that once a yellow came out, that all drivers should hold their position, and not try to take advantage of the yellow flag, especially if it was nowhere near the end of the race. This practice, however was never official, and the self-policing of it was very inconsistent.
This facet was magnified around the same time as the aforementioned Loudon incident at the 2003 Dodge/Save Mart 300. On the 71st lap, Kevin Harvick was leading Robby Gordon when a caution came out for a crash at a different part of the track. Robby Gordon kept charging, and passed Harvick in the keyhole turn, taking the lead before they crossed the start/finish line. Harvick called it a "chicken move," and Jeff Gordon said "I could not believe it when I saw it" and called his passing under the yellow "unheard of."
The controversial pass, however, was entirely legal under NASCAR rules at the time, and Robby Gordon was assessed no penalty. The so-called "unethical breach of racing ethics" proved to be the winning edge, and Robby Gordon went on to win the race. He was subjected to considerable controversy; some ridiculed his action while others considered the complaints hypocritical or "sour grapes" by the losers.
Lapped cars.
In some cases, when the caution came out, leaders would purposely slow down, and allow lapped cars to pass them and thus get their lap back before they crossed the start/finish line. This was a long-standing practice, and frequently was part of race strategy. Sometimes by being kind enough to let a driver get his lap back, a favor would be expected later in the race in return.
This practice was scrutinized as well though, when it was seen to be abused. A controversy arose during the 2003 Samsung/Radio Shack 500 at Texas. On the 169th lap, the yellow came out for a spin with Matt Kenseth leading. Kenseth backed off in turn 4 to allow teammates Jeff Burton and Kurt Busch to get their laps back. Jeff Gordon, however, sped past all three and beat them back to the start-finish line, officially taking the lead. However, instead of Gordon keeping the lead, NASCAR scored Kenseth in front, while Busch and Rudd were allowed to make up a lap. After the race, NASCAR acknowledged the error.
After racing back to the yellow was eliminated, a special exception to this practice was implemented and allowed, by the beneficiary rule where the highest-placed car not on the lead lap is given a lap back if a caution occurs
Unofficial continuance of racing to the line.
Though racing to the yellow was officially banned in 2003, there have been numerous races that finished under green despite a last-lap crash as the caution did not occur, notably the 2004 Winn Dixie 250 at Daytona won by Mike Wallace the 2015 Alert Today Florida 300 won by Ryan Reed, the 2007 Daytona 500, the 2019 1000Bulbs.com 500, and the 2020 Daytona 500. NASCAR will not have a caution despite a crash on the final lap that would normally cause a caution anyway only if there is a crash occurs and that the road ahead for the leaders is clear, and no drivers involved in the crash need immediate help from trackside paramedics.
Current NASCAR rule.
As a result of these criticisms, NASCAR changed the caution rules in 2003. With the field being frozen in running order at the exact moment caution button is pressed by race officals, and the running order is determined by inspecting the order that the driver's transponders had passed a series of wire checkpoints around the track. In special cases, the transponder data can be supplemented with video replay (particularly for the leader/winner).
In order to not totally obliterate the possibility of regaining lost laps, NASCAR has implanted the beneficiary rule in which the highest-placed car not on the lead lap is given a lap back if a caution occurs.