Have you ever wondered why it is thought that impatience leads to undressing?

This exclamation comes from a time before modern manufacturing technology allowed clothes to be mass produced.
A shirt was a much more expensive item than it is today and so if someone were to get into a fight, it made good economic sense to take their shirt off first.

To tell someone to keep their shirt on meant calm down, I don’t want to fight you. ‘Keep your pants on’ is a colourful variation of this phrase.