The term literally meant that what ever was stated happened exactly as described without any additional figurative meaning. However, as is normal for human language, the meaning of the term has changed in general conversation. The new meaning is “I am not exaggerating the figurative meaning of this statement.” This change is a response to recent exaggerated use of figurative language.
For example, someone may witness a person trip and think that they were going to fall, so they could say, “I saw them trip and shit my pants.” They didn’t really shit their pants. They weren’t even close to it. They were surprised and slightly worried, so the use of shit my pants was an exaggeration of even the figurative meaning. In contrast, someone may correctly use the term in a figurative manner, such as, “When I saw that car run the red light and almost hit us, I was so scared that I literally shit my pants.” They don’t mean they actually defecated with their pants on, though that could have happened. What they mean is that they were truly scared as opposed to slightly scared. Thus, the term literally means “the exact figurative meaning of”.
How did someone trip and shit my pants? I got stuck there.
I saw them trip, and then I shit my pants because of it.
This was my thinking:
If they did the thing:
Crap. I may be wrong, but the grammar seems technically correct, though confusing and depends on context to understand.