A: The now-famous quote “sweating like a pig” comes from the works of George B. Cohan (1878–1942), who said it in an ad for his play Ali Baba, or the Four Slaves. As far as I can tell, there was no actual experience that he had with pigs at all, but the saying has since taken on its own meaning and become part of American pop culture.
Q: Where does this saying come from?
A: The phrase probably goes back to medieval times when people believed that pigs were unclean animals because they used their hairiness to cool down during warm weather by sweating profusely. When someone sweats more than is necessary it’s called overheating; thus overheated became overheat and eventually overexertion.* It might also have been derived from geese or other birds known for producing excessive amounts of sweat under hot conditions—like swans on St. Patrick’s Day or ostriches on July 4th—although there are many more theories about how this idiom came into existence.