Most people associate the letter eñe with the Spanish language. Yet it is actually present in no less than nine different alphabets spanning the globe, including the modern Latin alphabet, Galician alphabet, Asturian alphabet, Filipino alphabet and Guarani alphabet, among others. Additionally, it is currently used to represent the [ŋ] in the Tartar and Crimean languages, along with the Chamorro, Mandinka, Mapudungun and Tocharian languages. Considering the usage of eñe, it quickly becomes clear that the letter is present in a variety of geographical locations, and is used in languages stemming from different language families.
The tilde that sits atop the n to form what is now a separate letter in its own right, originally began as shorthand. It represented a double letter, in this case nn, which was used more frequently in Old Spanish. The word año, for example, was formerly anno and derived from the Latin word annvs. While this usage spread to many languages at the time, most of them eventually dropped the tilde. Meanwhile, Spanish retained its usage as shorthand for a double letter.
As far back as Medieval Latin usage, that tilde came to represent a nasal sound following a vowel (then also used on the letter m). The presence of eñe in Spanish has since expanded to all instances in which the palatal nasal sound is present, even when it does not represent a former double letter, such as with señor.
More recently, there has been cross-linguistic usage in native languages located in or near predominantly Spanish-speaking areas. These languages include Aymara, Quechua, Basque, Leonese, Yavapai, and Tetum. The orthographies of these native languages and others with cross-linguistic usage of eñe all have some basis in Spanish. It is also present in English words borrowed from Spanish, such as jalapeño, piñata, and piña colada.