For most of history a coin was a small piece of precious metal, and it was worth the silver or gold inside it. That made the edge a target. Thieves known as clippers shaved or snipped thin slivers from the rim, spent the coin as if it were whole and kept the metal.
In England the answer came from a machine. The Royal Mint Museum explains that the new presses made thicker, more uniform coins and allowed security features such as milling and edge lettering, which made coins harder to counterfeit and stopped them being clipped. Production with the new machinery began in February 1662. A ridged edge is a pattern, and a pattern with a bite taken out of it shows.
The old smooth coins stayed legal, though, and the shaving went on. By the 1690s, according to the University of Oxford project Newton and the Mint, the market value of silver was higher than the face value of the coins, clipped money was everywhere and business was grinding to a halt. In 1696 Parliament ordered all the old silver coin melted down and struck again. Isaac Newton arrived at the Mint in the Tower of London in April 1696 as Warden. The recoinage took about three years and produced 6.8 million pounds of new silver money, and Newton's main duty became tracking down and prosecuting the clippers and counterfeiters. He interviewed criminals and informers himself.
The ridges outlived the silver. The US Mint's own specifications give a dime 118 reeds, a quarter 119 and a half dollar 150. The first quarter, struck in 1796, was silver. In 1965 the Mint took the silver out, and today's quarter is a copper core between layers of copper and nickel, 8.33 percent nickel and the rest copper. There is nothing left on the rim worth shaving, but the ridges are still there on every quarter in your pocket.