This is a phrase that people often say sarcastically. That means that people say "Thanks a lot" but they actually mean the opposite. They mean that they're not happy with what someone said or did.
Say "Thanks a lot!" in situations like these:
Your friend says something about you that's supposed to be nice, but sounds like he's criticizing you.
The other members of your family eat dinner while you're out but don't save any food for you.
Other phrases that use "Thanks" don't sound as sarcastic as "Thanks a lot". They sound genuine:
Thanks a bunch!
Thank you so much!
But people usually use "Thanks a lot" in a sarcastic way.
"Thanks a lot" is pronounced with stress on both "thanks" and "lot".