The Phrase Finder comes to the rescue once again. The expression means something is a certainty. It is “…a pseudo betting term…a pleasant-sounding alliterative phrase which indicated short odds—dollars are valuable but donuts aren’t. The phrase parallels the earlier English expression ‘a pound to a penny’.” The phrase originated in the mid-19th century, with the earliest printed example found in an 1876 edition of The Daily Nevada State Journal.