They mean the same thing but are used differently. The best I can do is give you some examples.
"Did you earn a lot of money from your car sale?"
"Did you earn much money from your car sale?' Both are correct. The first implies that the speaker thinks a great deal of money might have been earned. The second one implies that the speaker thinks that maybe not very much money was earned. It is a subtle difference.
"Do you like a lot of different kinds of flowers?"
"Do you like much different kinds of flowers?" Both are OK. The first is asking if I like many varieties of flowers. The second is asking if I like flowers that are very different from each other, or very different from the flowers we are looking at. Again, a subtle difference.
" A lot of" is also more colloquial.