Long explanation:
"Dollar" is a mispronunciation of "thaler", a German/Dutch nickname for guilders minted in the Bohemian town of Joachimsthal in the 16th century. By the time of the Elizabethan era, Shakespeare was generically referring to money as "dollars".
This name was transfered to the Spanish gold peso commonly used as currency in the American Colonies (due to scarcity of English specie and frequent trade with the Spanish colonies to the south) in the 18th century. The "Spanish dollar" was also known as a "real de a ocho" or "piece of eight" because it was scored so as to be easily broken into eight pie-slice shaped pieces, or bits, each worth one real, for the ease of making change and to avoid the problem of minting more than one style of coin.
Therefore, a dollar was easily broken into eight bits. The practice was discarded because the pieces never broke evenly, so some of the bits contained more gold than others, even though they were supposed to be worth an equal amount. Unscrupulous people would even shave off a little of the gold in order to short-change others, conserving the scraps in order to mint new coins, etc .
Since the currency of the United States is decimal based a dollar is no longer easliy divisible by eight, but it can be divided into fourths (quarters). Two eighths equal one quarter, so a quarter equals two bits and a dollar still equals eight bits.
Interestingly, the ability to physically break apart a dollar for change has made its way into our modern usage: "Can you break a fifty?" for "Can you make sufficient change if I give you a $50 bill?"