I wanted to buy some mini marshmallows recently, so I went on Amazon. Perhaps because of their resemblance to packing material -- light, bulky, ubiquitous -- I figured they'd be cheap. But when I found the most popular brand, not only did the marshmallows cost twice what I'd pay at my local store, but the price had skyrocketed overnight.

Just beneath the placid surface of a typical product page on Amazon lies an unseen world, a system where third-party vendors can sell products alongside Amazon's own goods. It's like a stock market, complete with day traders, code-slinging quants, artificial intelligence algorithms and, yes, flash crashes.

Amazon gave people and companies the ability to sell on Amazon.com in 2000, and it has since grown into a juggernaut, representing 49% of the goods Amazon ships. Amazon doesn't break out numbers for the portion of its business driven by independent sellers, but that translates to tens of billions in revenue a year. Out of more than 2 million registered sellers, 100,000 each sold more than $100,000 in goods in the past year, Peter Faricy, Amazon's vice president in charge of the division that includes outside sellers, said at a conference last week.

It's clear, after talking to sellers and the software companies that empower them, that the biggest of these vendors are growing into sophisticated retailers in their own right. The top few hundred use pricing algorithms to battle with one another for the coveted "Buy Box," which designates the default seller of an item. It's the Amazon equivalent of a No. 1 ranking on Google search, and a tremendous driver of sales.

To see what all this means for the consumer, download the Chrome extension Keepa, which will show you the price history for any given item on Amazon. For the marshmallow listing I had been eyeing, the wild pricing gyrations resembled a penny stock during heavy trading.

Amazon's retail business "is like this massive slowed-down stock exchange," says Juozas Kaziuk nas, founder and chief executive of Marketplace Pulse, a business-intelligence firm focused on e-commerce. The usual market dynamics are at work: Sellers entering and leaving the market, temporary scarcity when someone runs out of stock or a manufacturer falls behind, and sellers testing consumers and each other with high and low prices.

The vendor of the marshmallows I wanted told me his high price was an attempt to bait competitors into raising their own asking prices for the item. This works because sellers of commodity items on Amazon are constantly monitoring and updating their prices, sometimes hundreds of thousands of times a day across thousands of items, says Mr. Kaziuk nas. Most use "rules-based" pricing systems, which simply seek to match competitors' prices or beat them by some small fraction. If those systems get into bidding wars, items offered by only a few sellers can suffer sudden price collapses -- "flash crashes."

More sophisticated systems for pricing are offered by companies like New York City-based Feedvisor, which claims to use artificial intelligence to learn the market dynamics behind every item in a catalog. This system is "set it and forget it," says Barry Lampert, one of Feedvisor's customers and a top-500 seller on Amazon. The algorithm will often raise the price on items in a seller's catalog, to see if other sellers will follow suit. The goal is to maximize sales while avoiding bidding wars that can be a race to the bottom.

The result, said my marshmallow merchant, is that the customer isn't always getting the absolute best price, especially compared with in-store retail. But the point of Amazon, he adds, isn't to offer a consumer the absolute lowest price possible; it's to offer the lowest price possible given the convenience that Amazon offers. "Free shipping, " after all, isn't free for the seller.

As more sellers compete on Amazon, it's possible price volatility will increase. At the same time, the percentage change in any given price is likely to shrink, says Victor Rosenman, chief executive and founder of Feedvisor. Just as in any other market, the more sellers there are for an item, the less power any one has to affect its price.

The rapid growth of Amazon's third-party seller program and the cutthroat competition Amazon encourages mean the mix of sellers on Amazon has changed tremendously since its inception, and will continue to change, says Mr. Kaziuk nas. Initially, it was mostly sellers engaged in retail arbitrage -- buying things from actual stores or wholesalers, then selling them for a higher price on Amazon. Later, better-organized resellers who bought directly from manufacturers piled on. Now, many resellers are feeling squeezed out both by manufacturers, who are more than ever selling through Amazon directly, and by bigger, tech-savvier fellow merchants.

The most vigorous competitor to sellers on Amazon is, in many cases, Amazon itself. The merchants I interviewed say it is common for Amazon to notice a product category that does well and begin selling it as well. Amazon may even go further and develop a house-branded version of a product. While the price of a pack of Duracell AAA batteries, for instance, fluctuates from one day to the next, the price of Amazon's own brand of AAAs is stable -- and, as of this writing, costs almost half as much per battery.

Mr. Lampert says he worries every day about Amazon moving into his most lucrative product categories, which often happens. That's one reason he maintains shops on other platforms, including those operated by Amazon competitors eBay and Wal-Mart's Jet.com.

In the end, Amazon seems to be fulfilling its promise of using its platform to lower prices while expanding the variety of items available to the customer. The question for its partners, however, should be whether or not their own businesses may eventually be disrupted in the name of customer service.

Write to Christopher Mims at christopher.mims@wsj.com