Zuleika, I'm not a scientist but I've read lots of sources about the hormones contained in tears. The most famous study was done by Dr. William Frey, who studied tears caused by onions to crying for emotional reasons, and found that the tears cried for emotional reasons contained stress hormones.
Crying is a way the child relieves distress, and one aspect of this, is reducing the amount of stress hormones in the body.
the article I linked to isn't about the scientific claims, but has some great ways to help children release the feelings, that make them want to suck their thumbs. Here are a couple that talk more about crying research.
Health benefits tears
Daily Express Article health benefits of crying
you're right, babies do suck their thumbs in the womb, but I think when thumb sucking goes beyond infancy then it's for comfort reasons.
As a long term thumb sucker who was also bullied at school, I'm pretty certain that if I'd felt safe to express my feelings, get help about my situation, and some connection with my parents, then I wouldn't have needed to suck my thumb to supress my feelings.
It's a big paradigm shift, to think that sometimes the best thing we can do, is to listen to our children when they are upset, rather than trying to distract or stop the crying as quickly as possible, but the health benefits of tears are pretty well-documented.