The story
According to Spanish philologist and dialectologist Manuel Alvar López, alfajor is an Andalusian variant of the Castilian alajú, derived from the Arabic word الفَاخِر, al-fakhir, meaning luxurious, and, contrary to some beliefs that it originated in the New World, was introduced to Latin America as alfajor. The word had been introduced into Spanish dictionaries in the 14th century.
A similar sweet called alaú is found in the Arabic-Hispanic cookbook Kitab al-Tabikh, by an anonymous author. The Spanish grammarian Nebrija noted the word for the first time in his Latin-Spanish Dictionary (1495) as: alfaxor or alaxur. In the 12th century, Raimundo Martin describes in his book Vocabulista another possible etymology of the Hispano-Arabic fasur, meaning "nectar".
The publication of historical dictionaries of the Spanish language allows one to document both forms of the original alajur, written as alajú and alfajor. Alajur and multiple geographic variations are sweets made of a paste of almonds, nuts, breadcrumbs and honey. It is possible that alfajor and alajú were Arabisms introduced into the Spanish language in different places and times, and, supposing both came from the same etymology, from a linguistic point of view, alajú is probably an Arabism of Castillian Spanish, and so it is still alive in Cuenca, Toledo, Guadalajara and in la Sierra de la peña de Francia; meanwhile the variation alfajor is Andalusian and Murcian. In the Americas, the word alfajor was not known until the 19th century.
From Wikipedia’s article on Dulcería Castañeda, shared under CC BY-SA 4.0.3