In Pixar's Cars, Doc Hudson raced under the number 51 during his Piston Cup career.
Doc's number is shown in flashbacks and in memorabilia connected with his earlier racing life. He was once known as the Hudson Hornet, a champion who won three Piston Cups before a crash ended his career. His later life in Radiator Springs hides that history from Lightning McQueen at first.
The number 51 is associated with the real Hudson Hornet's racing legacy as well as the fictional character. Hudson Hornets competed successfully in early stock-car racing, especially in the NASCAR era of the early 1950s. Pixar used that historical identity as the foundation for Doc's design and backstory.
Doc's secret matters because it explains both his driving skill and his bitterness toward the racing world. He mentors McQueen only after the younger car learns to respect the town and understand what happened to the champion who came before him.