system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why is it that your body's response to heights and hanging on for life is to have sweaty palms?

Seems counterintuitive to have sweaty palms in a situation where you are hanging onto a ledge for dear life.
gpt
You're describing a situation where the person is having a fight-or-flight response.  What is happening is that your sympathetic nervous system becomes activated so you can better cope with threats to your survival. 

Some of the benefits are 
 
* Increased blood flow to the muscles activated by diverting blood flow from other parts of the body.

* Increased blood pressure, heart rate, blood sugars, and fats in order to supply the body with extra energy.
* The blood clotting function of the body speeds up in order to prevent excessive blood loss in the event of an injury sustained during the response.

* Increased muscle tension in order to provide the body with extra speed and strength.

Sweating is just another symptom. Since you won't be hanging off a cliff the majority of the time, this is not really a problem.