The word "tapas" is derived from the Spanish verb tapar, "to cover". In pre-19th century Spain tapas were served by posadas, albergues, or bodegas, offering meals and rooms for travellers. Since few innkeepers could write and few travellers read, inns offered their guests a sample of the dishes available, on a "tapa" (the word for pot cover in Spanish).
According to The Joy of Cooking, the original tapas were thin slices of bread or meat which sherry drinkers in Andalusian taverns used to cover their glasses between sips. This was a practical measure meant to prevent fruit flies from hovering over the sweet sherry.
The meat used to cover the sherry was normally ham or chorizo, which are both very salty and activate thirst. Because of this, bartenders and restaurant owners created a variety of snacks to serve with sherry, thus increasing their alcohol sales. The tapas eventually became as important as the sherry.
Tapas have evolved through Spanish history by incorporating new ingredients and influences. Most of the Iberian Peninsula was invaded by the Romans, who introduced more extensive cultivation of the olive following their invasion of Spain in 212 B.C. and irrigation methods. The discovery of the New World brought the introduction of tomatoes, sweet and chili peppers, maize (corn), and potatoes, which were readily accepted and easily grown in Spain's microclimates.