In Spain, people end their New Year's Eve celebration by eating 12 grapes at the stroke of midnight. According to this deep-rooted Spanish tradition, each grape one eats brings good luck and represents a wish for each of the new year's twelve months.
According to historical documents, the Spanish bourgeoisie ate grapes to celebrate the new year as early as the late 19th century. Jeff Koehler, an American journalist, has put forward two theories about the origins of this custom in his book Spain.
The first theory suggests that in 1909, grape producers in the province of Alicante had an excellent harvest so they carried out a Christmas campaign to boost their sales. As a result, the sale of packages of twelve-ready-to-eat-on-New-Year's-Eve grapes became popular.
The second theory suggests that the custom existed before 1909 and that it originated in Madrid around 1880. At that time, residents of Madrid started to eat grapes to make fun of the Spanish bourgeoisie who, like their French counterparts, liked to indulge in champagne and grapes at parties during the Christmas period. As a curiosity, the city council of Madrid the usual street festivities of the evening of Twelfth Night while these festivities were taking place.
Source: heraldo.es