The New South Wales colonial government requisitioned 40,000 Spanish dollars from India to produce the coins from, at a bargain rate of 4 shillings per dollar (the usual rate back in England was 4 shillings 9 pence). The centre of the dollars was punched out, the resultant ring stamped with a new value of 5 shillings, and the plug which was punched out of the coin was ground flat and used as a blank for a second smaller coin (the Dump) valued at 15 pence (or 1 shilling and 3 pence). The two new coins together had a combined face value of 6 shillings 3 pence, scoring the colonial government a net profit of 1 shilling 6 pence per Spanish dollar. They got a convicted forger (New South Wales was a prison colony, so they had plenty of convicted forgers at hand) to make the dies and stamp the coins.
The motivation was not only to make the government a little bit of seigniorage profit, but to both create a variety of denominations of locally acceptable coins and to create coins which would be undesirable for visiting merchants to keep (since no-one else on the planet would have given the merchant 5 shillings for a mutilated dollar), and therefore the coins would not leave the colony. As with most British colonies in the early 1800s, there was a serious shortage of circulating coinage, with whatever tiny amount of coins arriving in the colony usually leaving on the visiting merchant ships since the colonies were, for the most part, net importers of goods.
Ultimately, the Holey Dollar experiment proved futile, as visiting merchants simply raised their prices to compensate for the devalued currency, and took the coins away anyway. For which we should probably be thankful, as a large proportion of the surviving examples of these coins would have been out of the country when the coinage was officially recalled for destruction from 1822 and demonetized in 1829.
The Holey Dollar was not without precedent; on the far side of the world, the British colony of Prince Edward Island (now part of Canada) also in 1813 acquired 1000 Spanish dollars and did pretty much the same thing, only somewhat more crudely with just a ten-pointed star stamped into the Holey Dollar and the Dump (known as a "Plug" in PEI); the PEI dollar was also valued at 5 shillings and the Plug valued at 1 shilling. This in turn follows from earlier Caribbean colonial efforts in cutting and counterstamping pieces of Spanish dollars.
Trivia time: although the "Dump" would originally have been a plug taken out from a Holey Dollar, the two coins do not fit snugly inside each other as one might expect. This is because the ring die on the Holey Dollar has flattened and squashed the metal around the hole, making the hole smaller than it originally was, while the Dumps were struck without a collar and so have flattened out and broadened, making them larger than the original hole.
Don't say "infinitely" when you mean "very"; otherwise, you'll have no word left when you want to talk about something really infinite. - C. S. Lewis