Spanish is the particular dialect which arose in the region of Castile. The language spread to other parts of Spain apace with Castillian conquests, and overwhelmed other local dialects. The first major instance of literary Spanish is the Song of Mio Cid, an oral epic poem first committed to writing by an anonymous troubadour in the 12th century. A distinctive feature of Spanish is the large number of Arabic words it incorporated during the centuries-long Moorish presence in Spain. For much of the Moorish period Romance was the lingua franca in both Christian and Muslim Spain.
Language continually evolves.
You can still get an idea of how Spanish was spoken when Columbus sailed for America by listening to a speaker of Ladino. This is a variant of Spanish spoken by Sephardic Jews, and contains many traits of the language as it was when the Jews were expelled from Spain at the end of the 15th century. Catalan and Gallego, like Spanish, are Romance languages. They are not dialects of Spanish, having evolved directly from Latin. Both have significant bodies of written literature.