But when something either excites or scares you, your body releases the stress hormones adrenaline and cortisol. These trigger a ‘flight or fight’ response in your body, setting your heart pounding and alerting not just the eccrine glands, but also the glands located in your armpits and crotch called the apocrine glands. That sweaty palm feeling is exactly what our ancestors would have felt when confronted with a hairy mammoth. In other words, it's a bit of evolutionary leftover.
Excessive sweating (also called hyperhidrosis) can be exacerbated by certain factors, such as obesity, alcohol use, conditions including diabetes or an overactive thyroid gland, menopause, and certain medications.