Customers have long enjoyed the ability to shop online without paying those pesky sales taxes. But they may not have realized why they enjoyed this privilege.

It came to them courtesy of Quill Corp. v. North Dakota, a 1992 Supreme Court ruling that said that states couldn’t collect sales taxes from companies that didn’t have a “physical nexus” within the state. What constitutes a “physical nexus” is a fascinating and somewhat complicated question we will leave for another day. In effect, it meant that most companies with no physical presence in a state could sell goods to the residents of that state tax-free.

In theory, the residents were supposed to remit the taxes themselves. In theory, no one is supposed to drive above the posted speed limits. Theory often deviates from practice.

In 1992, of course, it was rather burdensome to order most goods and services from far-off retailers. Catalogue shopping was inconsequential to state and local tax revenue. Meanwhile, it would have been extraordinarily burdensome to require every mail-order business in the country to deal with 50 different state revenue services, plus any localities that might care to get in on the game.

But then along came the Internet, which changed everything — including, apparently, Quill Corp. v. North Dakota, which has just been overturned by a new Supreme Court ruling in South Dakota v. Wayfair. (Why are the Dakotas so prominently featured in these cases? Presumably because residents of large, rural states display an unusually keen interest in the convenience and variety offered by stay-at-home shopping.)

The Supreme Court has been signaling for a while that it might go in this direction. A combination of technological change and the tax benefits offered by Quill have caused e-commerce to explode in the 26 years since the ruling. Meanwhile, the Internet has also simplified the problem of remitting taxes to so many different locations. With the rise of real-time computerized inventories and shipping, businesses can now easily break down their sales by state, and third-party software can help them calculate the appropriate taxes to pay to each government.

However much sense Quill made at the time, the Supreme Court appeared willing to reconsider whether it still made sense today. South Dakota obligingly passed a law in 2016 levying a sales tax on all purchases from businesses that did a certain volume of sales in the state, and fought for it all the way to a Supreme Court victory.

The decision will undoubtedly have major effects on e-commerce, but not necessarily the effects you might think — at least not if your first thought was, “This is bad news for Amazon.” Amazon (whose owner, Jeff Bezos, owns The Post) undoubtedly derived a significant competitive advantage from Quill, at least in its early years. But many of Amazon’s critics, including President Trump, seem unaware that as the Internet retailer has grown, that tax advantage has largely disappeared.

That’s because getting goods to people on the accelerated schedules promised by Amazon Prime means building warehouses closer and closer to where those customers are located. Over the years, Amazon has established a “physical nexus” in more and more states, and as Chief Justice John G. Roberts Jr. noted in his dissent, “Some companies, including the online behemoth Amazon, now voluntarily collect and remit sales tax in every State that assesses one—even those in which they have no physical presence.”

As Roberts’s observation suggests, Amazon isn’t the only major online retailer collecting sales taxes. Best Buy and Walmart rack up far more in online sales than many “big” Internet retailers such as Wayfair, and they already have physical presences almost everywhere. The court’s ruling won’t affect players like these.

It will, however, affect companies like Wayfair, making it harder for them to compete against bigger retailers. Ultimately, the effect of this ruling will be not to keep tech giants like Amazon from stealing business from mom-and-pop shops, as critics of those firms might hope. Rather, the ruling will make it harder for upstarts to unseat massive incumbent Internet sellers that can afford to have a physical presence in every state, or to collect sales taxes even where they don’t.

Despite the ruling’s negative impact on small businesses, states will likely move quickly to avail themselves of this newly legal source of tax revenue. So bid a fond farewell to those great deals from Internet upstarts. We sure did enjoy them while they lasted.