The Phonecians gave a name to the peninsula which is today Spain and Portugal with the word "I-shpan-ha," which is thought to have meant "land or island of hydraxes," as those people might have confused hydraxes (which they called "shpan") with rabbits, which are common in Iberia. Romans, who began their conquest of the region during the Second Punic War in 210 BC, continued to use the same word, "Hispania," and elsewhere did refer to Spain as "the land of rabbits." There is even a coin from Hadrian's rule that includes a rabbit in the same way the Egyptian coin bears an Ibis. "Iberia" was the Greek word for the same place, so the words can be used interchangeably.
Before the Romans came to Hispania, several languages were spoken in various areas (called "paleohispanic languages"), including the languages of the Iberians, Basques, Celtiiberians and Gallaecians, some of which languages were related distantly to Latin through Indo-European language roots, while others weren't related at all. From these neighbour languages some words remain today in Spanish, such as the Celtic "camino," "carro," "colmena," and "cervesa" and the Celt suffixes "-iego" and "ego," while many place names, surnames and common words such as "izquierda" come from Basque (although many of the place names entered the language during the Reconquista, in which many Basques took part, a millennia after the first "Spanish" was spoken in Iberia).
The speakers of the first "Spanish" were those who in this Roman colony spoke one of the dialects of Roman Latin that came to be used there. Through the course of historic events, the particular dialect that came to spread over all of Spain was the one spoken in central Iberia around Toledo, in the Kingdom of Castille, but that didn't happen until around 800 years after the fifth-century breakup of the Roman Empire.
Early, "Spanish" was just one of the prodigious children of Roman Latin, some of which still live today in more developed forms, including Italian, with is today very similar to Spanish, the two languages sharing most of their vocabulary and grammar and the Latin phonemic system. For example, while today's Spanish is 20% distant from Roman Latin, Italian is only 12% distant (and Sardinian is 8% distant, all according to the linguist Pei), and speakers of Romance languages share a high level of mutual intelligibility: Spanish has around 89% intelligibility with Portuguese, 82% with Italian, and around 73% with French, having a much higher degree of intelligibility when read than when spoken, demonstrating that much of the difference is phonological.
In 711 the Muslim conquest of Spain began, succeeding in most of the peninsula for hundreds of years, during which time the majority of the Christian population (which mostly remained Christian, although many of those who wanted a place in the powerful parts of the society controlling the land were more enthusiastic about the Muslim faith and conversions) spoke a mix of the preexisting Latin and Arabic (a mix we call "Mozarabic") until the 11th century, and today 8% of Spanish is Arabic in origin (around 4,000 words), including common words like "aceite," "zanahoria," "azul," "azúcar,"technical words (such as those describing irrigation, "atarjea," "acequia," "arcaduz," and "aljibe,") scientific words such as "algebra," and titles such as "alcalde." In addition to the Latin-Arabic mixed language, a large population spoke a Latin-Judean language ("Ladino"). Both of these languages had vanished by the 16th century, but that the population spoke a mixed/bilingual language like this is considered to have facilitated the transfer of vocabulary from Arabic to Spanish.
The Reconquista spread the language of the kingdom of Castile over the bulk of Iberia, partly through poems and songs about the heroes of these great battles and adventures (including those by El Cid in the 11th Century).
A big push towards the Castilianization of Iberia took place in the 13th Century under King Alfonso X ("Alfonso the Wise") who assembled scribes in his court and tasked them with writing works on history, astronomy, law, and other subjects of interest. Writing continued to enforce Castillian Spanish between the 13th and 16th centuries from Toledo, and after that from Madrid.
It was during this time that Germanic sailors influenced Castille to replace their "septentrion," "oriente," "meridion," and "occidente," with "norte," "este," "sur," and "oeste," (although Germanic words don't feature very large at all in Spanish) as this was a time when ocean voyages were increasing. While the first Castillian grammar book was written in Salamanca and presented to Queen Isabella I, Cristóbal Colón was beginning his 1492 mission to sail west to Asia.
In the New World, Spaniards adopted from American peoples or created new a variety of words, and from the neighbouring Romance languages they were more frequently exposed to, including that of Renaissance Italy, they also received some new vocabulary. From the Americas, new things meant new words, such as "tomate," "aguacate," "mosquito," "cigar," as well as other novel flora, fauna, and cultural concepts.
The solidification of Spanish began in earnest, we might say, in 1713 with the first founding of the Spanish Royal Academy, built for the purpose of standardizing the Castillian language with its publications of dictionaries and grammars that continue to this day. There is one such academy in every Spanish country, held together by the Association of Spanish Language Academies that was created in 1951.
Today Spanish adds new words from its own technical and popular culture, although it has been remarked that for its size, Spanish does not feature prominently in any scientific writing outside of the humanities (social sciences, medical sciences, and arts and humanities making up 75% of scientific production in Spanish), while Spanish literature, on the other hand, continues to feature large in the world.
These days, Spanish also adds to its around 100,000 real-use words from English, which is also adding to its 200,000 real-use words, mostly with new technological, sports, commercial, and pop vocabulary.
Thus the participants in the Spanish language include Basque, Iberian, Celtiberian, Phoenician, Roman Latin, Greek (much through the Roman, but also for scientific terms especially beginning around the 13th Century), Visigothic, Arabic, Hebrew, French and other Romance languages, German, Quechua, Nahuatl, other American languages, and English.