The word “spell” comes first from the old German word spel, meaning variously a story, telling a story, or a type of narrative song. According to the common lore: * Later, in England and elsewhere, the derivative term “spellings” referred to the entries magicians made in books they called “grammars”, in which they recorded various terms, phrases, and other verbiage in order to preserve the correct order, pronunciation, and so forth. Eventually these terms changed, as words often do, and today we refer to the books as grimoires and their catalog of entries as spells.
*This is the popular story, but it’s also a bit of an embellishment.