Here's why:
* Metaphor: A metaphor directly compares two things without using words like "like" or "as." It states that something *is* something else. In this case, the person is being compared to a pig in terms of sweating.
* Simile: A simile compares two things using words like "like" or "as." For example, "He's sweating *like* a pig."
Since "sweating like a pig" doesn't use "like" or "as," it's a metaphor.