The original condiment called ke-tchup was a fermented fish sauce from China. It became popular among sailors for spicing up bland food on long ocean voyages, and folks in other parts of the world then tried to duplicate it for themselves. The recipes varied widely until any fermented and/or vinegary sauce was called ketchup.
But ketchup became truly American once it was wed with the tomato and bottled industrially. While an early ketchup recipe with tomatoes appeared in Britain in 1817, calling for “a gallon of fine, red, and full ripe tomatas [sic],” and also anchovies, shallots, salt, and a variety of spices, it was Americans who really invented tomato ketchup.
The American tomato, with its origins in what is now Mexico and South America, was introduced to Europeans and North Americans by the Spanish conquistadors, and by the 19th century had become a ubiquitous garden plant. (Earlier it had been considered unhealthy and even poisonous.) Tomatoes became the base of many a sauce or stew, and before long were bottled as concentrated, fermented ketchups, preserved with vinegar and spices much the same way housewives would make a mushroom ketchup.
Tomato ketchup was a sensation, but recipes still varied until a company called Heinz started tweaking the recipe to balance shelf life and taste. That's when the story really takes off, and the success of Heinz ketchup led to other milestones in American agribusiness and cuisine. Read the story of ketchup at Smithsonian.
(Image credit: Visitor7)