Full spoilers follow.
The opening Piston Cup ends in an unprecedented three-way tie between rookie Lightning McQueen, veteran champion The King, and the perpetually second-place cheat Chick Hicks, forcing a tie-breaker race in California. McQueen, who has just fired his pit crew mid-race for daring to suggest he change tyres, hurries west overnight and — after his transport driver Mack dozes off and McQueen is jostled onto the wrong road — ends up tearing up the main street of Radiator Springs. Sentenced by the town's judge to repair the road before he can leave, he first tries to cheat the job with a fast, terrible resurfacing and is made to start over.
The central revelation: the crotchety judge and doctor, Doc Hudson, is the Fabulous Hudson Hornet, a three-time Piston Cup champion. McQueen discovers a hidden room of trophies. Doc's bitterness is explained by what happened after a catastrophic crash: he recovered, returned, and found the sport had already replaced him with a rookie. Nobody came looking. That wound — being used and discarded — is the emotional engine of the entire film, and it recasts Doc's hostility toward McQueen as fear of watching the cycle repeat.
By the time the media find him and drag him back to the race, McQueen has fallen for Sally, befriended Mater, restored the road, and — in the film's most beautiful sequence — helped relight the town's neon. His departure is abrupt and joyless: he has everything he wanted and no appetite for it.
The final race. Trailing badly and out of sync, McQueen hears a familiar voice on the radio: Doc has come to California as his crew chief, with the citizens of Radiator Springs as his pit crew. Doc's dirt-track lesson — "turn right to go left" — lets McQueen recover from a spinout that would otherwise have ended his day. On the last lap, Chick Hicks deliberately wrecks The King, sending the veteran into a horrifying rollover on what was to be his final race. With the finish line clear and the championship his, McQueen brakes just short of it, drives back, pushes the battered King across the line so that he can finish his career on his own wheels, and lets Chick take the Cup. Chick wins the trophy to booing silence; McQueen wins everything else, including the loyalty of the crowd and a job offer from the glamorous Dinoco sponsor — which he declines, staying with the humble Rust-eze team that supported him from the start.
What becomes clear afterwards. The film is constructed as a rhyme between two careers. Doc was destroyed by a sport that treated a racer as disposable; McQueen's final act is the exact refusal of that logic — he spends his own victory to spare another champion the indignity Doc suffered. His loyalty to Rust-eze is the same gesture in commercial form. The closing movement, in which he establishes his racing headquarters in Radiator Springs and brings the world's attention back to the bypassed town, resolves the film's other tragedy: the place progress erased is put back on the map, not by nostalgia but by someone choosing it.
A layer of real-world poignancy sits over all of it. Doc Hudson's voice belongs to Paul Newman in his final acting contribution, and the story of a great racer whose career was cut short is told through an actor who was himself a lifelong racing driver. Co-director and co-writer Joe Ranft — the story mind behind much of Mater — was killed in a car accident in August 2005, before the film was finished, and appears in it as the voice of Red the fire engine.