The basic principle of Gresham's law is that bad money drives good money out of circulation. In this context, good money is currency with substantial worth: usually coins made from valuable metal such as gold or silver. Bad money is less valuable currency designated as valuable by a sovereign. According to Gresham's law, an economy containing both kinds of money will gravitate towards the bad currency.
Gresham's law holds true when individual economic actors are presented with a choice about what type of currency to use. Say a guy walks into a bar and wants to buy a cheap drink. He can use either a paper bill or a silver coin. If he is economically rational, he will use the bill and save the coin, since the coin retains independent value. If the economy contains the potential for inflation, the coin will remain valuable because of the metal out of which it is made. It is quite possible that the value of the metal will exceed the face value of the coin, creating an incentive to melt down the coin and sell the material.
Gresham's law goes into effect only in economies dominated by a sovereign. There must be valuable coins in circulation as well as currency that is assigned value. The sovereign must have the power to enforce the use of its artificial money, called fiat currency. In an unregulated economy, bills would simply be less valuable than coins; people would be unwilling to accept them as substitutes. The state must have the power, potentially, to forcibly intervene in order to guarantee its currency.
Another force driving Gresham's law, besides inflation, is the power of international trade. Even a highly effective government cannot artificially determine how currency is traded on the international market. Thus, even if domestic agents are forced to accept good and bad currency equivalently, the good currency will trade for more money in markets outside of the state's power. Consequently, in addition to being saved by individual domestic actors, good money will actively leave the economy in which the artificial equivalence is established.
The name of the law comes from Sir Thomas Gresham, who proposed the concept in 1558 in a letter to Queen Elizabeth. This name was attributed three hundred years later, in 1858, by Henry Macleod. In fact, the idea behind Gresham's law has been known since antiquity. George Selgin, a modern economist tracing the history of the concept, cites a reference to a similar idea in Aristophanes' The Frogs, which was written circa 405 B.C.