Amazon has become America's second $1 trillion company.

Amazon's (AMZN) total market value passed $1 trillion on Tuesday, following Apple's ascent into 13-digit territory at the beginning of August. Amazon and Apple now make up more than 8% of the entire value of the S&P 500, according to Howard Silverblatt, senior index analyst for S&P.

A trillion dollars may be an arbitrary threshold, but it's still a remarkable statement of how quickly the 24-year-old company has grown, and the boundless confidence investors have in its future.

Just contrast Amazon with the brick and mortar sector, where 90% of American retail spending still takes place. In order to get to a $1 trillion market cap, you'd have to add up the valuations of the 14 largest big box retailers ranked by 2017 revenues, from Walmart (WMT) to Autonation (AN).

Investors are also way more excited about Amazon than other grocery, building supply, and general retail stocks, which have an average price-to-earnings ratio of between about 20 and 40 for the previous year, according to New York University finance professor and valuation expert Aswath Damodaran. Amazon's price-to-earnings ratio is about 180.

So how did we get here?

For years, investors buoyed Amazon's stock without seeing the company generate significant profits, as it poured revenues back into the business: Building out its fulfillment center network, buying up companies, and developing new technologies.

But over the past year, Amazon has started turning up the dial on profits.

At the beginning of 2018, the company was worth just $580 billion. In the second quarter, the company's net income ballooned to $2.5 billion, compared to $197 million in second quarter of 2017.

Driving those margins: The success of Amazon Web Services, the company's cloud business, as well as the advertising it sells across its sites and revenues from Prime membership subscriptions.

Impressing skeptical investors

Watching Amazon flex its profit muscles has boosted analysts' enthusiasm for the stock even further.

Morgan Stanley recently raised its price target to $2,500, which would make Amazon worth $1.2 trillion, based on revenue growth projections of 24% per year through 2020. It values Amazon Web Services, now an ubiquitous layer of the internet that supports enterprises ranging from the smallest startup to the Central Intelligence Agency, at $375 billion.

The company's moves over the past year have even won over former skeptics who previously believed Amazon's stock was overhyped.

Daniel Martins, who heads his own independent research firm, thought Amazon was too expensive in early 2017 because optimistic growth expectations seemed already baked in to the price. But after evaluating its most recent financial results, including aggressive expansion into new industries and other countries, he now predicts Amazon could double in value by 2020.

"It's too high of a bar to assume that they'll succeed at everything that they do," Martins says. "But at the same time, I think Amazon is the best combination in the world of the scale of a large company anjd that entrepreneurial DNA with the spirit of a startup."

Amazon is appealing to investors because it appears able to dominate any industry it enters through the power of the data it has on Prime members and its ability to get stuff from point A to point B extremely quickly. Groceries! Healthcare! Financial services! Media! Even your home cleaning service!

But if that vision became reality, wouldn't it put Amazon on a collision course with antitrust regulators? Are investors pricing in the risk that a store that sells everything might get broken up?

Under current interpretations of federal laws, they probably have little to worry about.

Antitrust regulators typically look at whether a company has used its dominance in a given market to raise prices on consumers. So far, Amazon has only lowered prices — no competitive harm.

But scholars have raised concerns that over time, Amazon's control of consumer pocketbooks could prevent the next trillion dollar company from ever gaining traction.

"if it means a long-term innovation loss, the tradeoffs might be ones that we don't want to live with," says Hal Singer, a senior fellow at George Washington University's Regulatory Studies Center and a principal at Economists, Inc.

He has proposed creating a special tribunal for complaints that online platforms are unfairly discriminating against content providers or potential challengers, which Senator Mark Warner referenced in a policy framework for internet companies.

At the moment, though, no such protection exists.

"If antitrust stays the same, then there really is no risk," Singer says. "I think Amazon shareholders should sleep very well at night."

-- Chris Isidore contributed to this report.