Secret behind -mente in adverbs

As you might probably know, most of the adjectives in Spanish become an adverb if “mente” is added at the end of the word. When I first knew this, I was wondering why all the adjectives with “mente” are feminine form, and as I made research about it, I found that Latin has something to do with it.

mēns (mind)SingularPlural

the word “mente” is ablative form of mens(mind) in Latin, and it was a feminine noun. In Latin, this word is used with an adjective and naturally they took feminine form since the modifying noun was feminine. This word is used with adjectives to mean the state of mind. For example, they would say something like “lenta mente” (with a slow mind). And later on, by the time when they formed romance languages, the word “mente” was used as a suffix with a female adjective. So, in Modern Spanish, you would say “lentamente” with a feminine adjective and ‘mente”.