The Jig Is Up

What does the idiom “The Jig Is Up” mean?

Definition:

A secret illicit activity has been exposed; your trickery is finished

For example:

“The jig is up for the stock scammers—the FBI busted the ring last night.”