In 1992, when the Supreme Court adjudicated a dispute over sales tax between Quill Corp., a Delaware mail-order office-supply company, and the state of North Dakota, it inadvertently altered the future of e-commerce. The Court ruled that mail-order companies did not have to collect sales tax on customers in states in which they had no physical presence. At the time, the World Wide Web wasn’t even a year old, but this new loophole would lend a massive competitive advantage to Amazon.com when it was founded two years later.

As Amazon grew from an online bookseller into a retail behemoth, it built new distribution centers according to a plan that minimized the number of customers to whom it had to charge sales tax, thereby keeping its products cheaper. During this first phase, it clustered warehouses in Kentucky, which was near the UPS Worldport, its primary hub, and mostly placed the rest in small and low-tax states. When it came time to expand, Amazon moved mainly into states willing to temporarily exempt it from collecting sales tax on their citizens. When states didn’t cooperate, Amazon wasn’t afraid to play rough: The company ceased construction in South Carolina and pulled all job listings until lawmakers in Columbia agreed to a sales-tax exemption.

The Marketplace Fairness Act, a bill that would allow states to collect sales tax on all online sales, was first introduced in Congress in late 2011. (It has yet to pass, but has bipartisan support.) The following year, Amazon finally began to enter the populous states it had once strenuously avoided—suggesting a radical rethinking of company strategy. Industry observers now speculate that Amazon is ditching a nearly obsolete competitive tax edge for a new one: same-day delivery in a number of key markets, like San Francisco, Los Angeles, Dallas–Fort Worth, and New York City. It’s an expensive wager. If it fails, Amazon will join a short list of businesses that have lost money going long on Americans’ love of convenience. But with its tax-free days waning, it seems a bet it had to make.