The US is the reserve currency because of Bretton Woods. [1] Under the Bretton Woods agreements participating countries were to peg their currency to the dollar and the dollar, in turn, would be directly convertible to gold. The idea was to make it impossible for countries to artificially manipulate the value of their currency, and thus ease international trade standards.

The US' barrier to exploitation was on the gold clause. If we printed too many dollars, then other countries could do a gold call with the increasingly worthless dollars, get valuable gold in exchange, take the currency out of play, and the issue would be fixed. So punishment and self interest in a quite well designed system, kind of. The problem is we just printed a bunch of money anyhow and then when France decided to make a gold call with their reserves, we shrugged, defaulted, and just broke the agreement.

So this started the modern economic era in 1971 where currencies became completely detached and free floating. At that point about 85% of global reserves were USD. Countries began rapidly dumping the dollar and USD inflation began skyrocketing. In 1980 inflation in the US was at 13.5%! This era continued til around around 1990 with the USD falling to 47% of reserves, but then in 1991 the USSR collapsed leaving the US not only as the sole 'king' of the world, but also to former Soviet nations dollarizing once the dust had settled. This continued up til 2001 (USD at 72%) when there was both the dotcom bubble and the clear rise of China and Russia as global powers. We've now been on a steady decline since, with the USD currently down to about 56% of reserves.

[1] - https://en.wikipedia.org/wiki/Bretton_Woods_system