This is what Merriam-Webster's Learner's Dictionary has to say about this (maybe a bit too lengthy), on its Ask the Editor subpage:
The word many has two common functions:
A) It is often used as an adjective that describes a plural noun and tells us that there is a large number of that noun, as in these examples:
1. She worked hard for many years.
2. They were one of the many, many families that came to watch the parade._
B) Many is also commonly used as a pronoun, to mean “many people or things,” as in these examples:
1. Some people will come to the meeting, but many [=many people] will not.
2. We were hoping to sell our old books, but many [=many books] were not in good condition._
3. I know some of the people here, but not very many.
The fixed expression many a/an... is more formal than the single word many, and it is much less common. Many a/an... is used mainly in literary writing and newspapers. Like the adjective and pronoun many discussed above, many a/an... is used to indicate a large number of something. However, it takes a singular noun, which can be followed by a singular verb. Here are some examples:
1. It remained a mystery for many a year. [=for many years]
2. I've been there many a time. [=many times]
3. Many a politician has promised to make changes. [Politician and has are singular.]
And here's Oxford Advanced Learner's Dictionary, saying:
many a (formal): used with a singular noun and verb to mean ‘a large number of’:
Many a good man has been destroyed by drink.
So, they practically mean the same thing, but the second one is more formal, and less common in modern English.