Meaning to be discovered in the act whilst doing something illegal.

There are many who have speculated that this term comes from bank robbers having exploding red dye which marks both the loot and them. Others have said it comes from workers in the production of pistachio nuts who would eat all the profits and get caught with red hands.

Unfortunately, it's not that farfetched, and it comes from a time long before exploding dye or red nuts.

In fact, Webbie has it quite nicely put (in bold type for some odd reason) in Red-handed. It first appeared in that form in English in the mid-19th Century, and as an adjective "redhand" was common in Scots (the language of Scotland) since the 15th Century. A murderer caught red-handed still had the blood of his victim on his hands.