When the United States created its own money, it did not invent a new unit. The Coinage Act of April 2, 1792, the law that set up the US Mint in Philadelphia, says each dollar is to be "of the value of a Spanish milled dollar as the same is now current", with 371 and 4/16 grains of pure silver. That is about 24 grams, roughly the weight of five nickels today.
The Spanish milled dollar was the peso of eight reales, a big silver coin struck by the Spanish crown in its American mints, most of all in Mexico City, with more from Lima and Potosí. It traveled with trade all over the world, and in the American colonies it was the coin people actually had. English speakers called it a dollar, a name that goes back to the thaler, a large silver coin first made in a mining valley in Bohemia.
The new country did not push the Spanish coin out. A law signed on February 9, 1793 made foreign gold and silver coins legal tender at fixed rates, with Spanish milled dollars at 100 cents each. The same law said all other foreign silver coins would stop being legal tender three years after the US Mint started striking its own, but it made an exception for Spanish milled dollars and their parts. They stayed.
They stayed until an Act of February 21, 1857, which repealed every law that made foreign coins legal tender. That act also tells you how the Spanish coins were used. It lists "the fourth of a dollar, or piece of two reals", "the eighth of a dollar, or piece of one real" and the half real, and says the Treasury and post offices would take them at 20, 10 and 5 cents and send them to the mint to be melted and coined again.
One real was an eighth of a dollar, and Americans called it a bit. Two of them made a quarter, which is why a quarter is still sometimes called two bits. The same 1857 law also ended the half cent and made the cent smaller, 88 percent copper and 12 percent nickel.