When Steve Conine and Niraj Shah met at Cornell University in 1991, neither anticipated that they would build a nearly $5 billion e-commerce business selling, of all things, shag rugs and grandfather clocks.

Today, their most successful company--Wayfair--does exactly that. The Boston-based company is now the largest online-only retailer of home goods, pulling in $4.7 billion in 2017 alone. Since launching in 2002, Wayfair has grown to more than 10,500 employees, hawking more than 10 million items across categories including home furnishing, décor, and home improvement.

On Tuesday, the e-commerce giant will appear before the U.S. Supreme Court in an effort to maintain a 1992 ruling that allows e-commerce retailers to not collect local sales tax unless they have a physical presence in the state. Wayfair argues that a change would impose an unnecessary burden on small retailers, which could end up owing state and local taxes, in addition to back taxes for previous years of service.

Meanwhile, brick-and-mortar retailers--including those represented by the state of South Dakota--argue that a reversal of the decision would provide a fairer environment for doing business. "The current tax system favors online retailers over brick-and-mortar business, and undermines fair and open competition in the marketplace," the National Retail Federation noted in an official brief.

Wayfair's impressive growth is hardly the result of tax avoidance. Indeed, the company, formerly known as CSN Stores, launched as a collective of niche merchants, peddling things like television stands and shag rugs. Shah and Conine--who remain CEO and CTO of Wayfair, respectively--operated the nascent e-commerce service from the latter's Boston townhouse, taking a cut of the revenue from companies with names like HotPlates.com.

The secret sauce, investors say, has been the founders' data-analytic know-how: By extracting information from online search, they were able to learn what customers were searching for, and build out a presence in those new categories. By 2010, the company worked with around 200 third-party websites, serving 4.8 million customers and notching $380 million in revenue.

The real turning point, however, was in a massive rebrand that transformed those 4.8 million customers from niche shoppers into a community of home goods enthusiasts. In the fall of 2010, Shah and Conine recognized that by converting their sites into a single platform--dubbed Wayfair--they could persuade browsers of, say, diaper bags to scroll through and purchase cribs, dressers, and mobiles, too, all in one fell click. That year, they raised their first round of capital--a total of $165 million--from investors such as Spark Capital, Battery Ventures, Great Hill Partners, and Harbour Ventures.

In many ways, that was the change that brought Wayfair from online merchant to billion-dollar business venture. And by 2014, the company went public on the NYSE, raising $319 million at a $3 billion valuation.

To be sure, the company faces steep competition from the likes of Amazon and Walmart, which are similarly hoping that the Supreme Court elects not to overturn its sales tax ruling. Wayfair has argued that more than 16,000 different taxing units could demand sales tax collections from e-commerce companies, a cost that could certainly set its revenues back. The Trump administration, which has argued that Amazon does not sufficiently collect local sales taxes, will join the oral argument in favor of such online retailers being required to collect them everywhere.

Nevertheless, with a formula that has helped Wayfair to catapult to success over the past 16 years, it's far from just an existential threat. "These guys quietly built one of the great e-commerce powerhouses while somehow avoiding the limelight," noted Eric Paley, a managing partner with the Boston-based seed fund Founder Collective, in a 2012 interview with Inc. magazine. "They found a great formula, and they've been able to keep executing on that formula without ever hitting a blip," he said.