When Amazon started they were far from dominant. For a long time they only sold books. Then they only sold
classical music CDs. Bit by bit they added other things, like other music, DVDs, and eventually basically all retail goods.
But for years they were basically just one among many sites, and not even terribly notable in the overall retail space. There were lots of other companies selling lots of other stuff at the time. Buy.com, for example, and ebay of course. Of all the ways to buy things online amazon was pretty far down the list until the mid 2000s.
What Amazon brought to the table was a unique combination of good web dev / services skills and top notch fulfillment logistics. And highly competitive pricing. Buying things on amazon was just a better overall experience compared to other sites. For example, when you put something in your shopping cart on amazon it stays there, it doesn't magically disappear for some artificial reason. And the overall experience of search/browse, read reviews, add to cart, then checkout, which today is commonplace throughout online retail was really particularly well honed by amazon. They didn't invent the form but they shaved off all the hard edges. This meant that amazon had much better customer retention than other sites and as amazon added new product lines existing amazon customers often decided to just use amazon for those things too. It took years and years for that momentum to snowball into the online retail juggernaut that Amazon is today.
A lot of other companies at the time had more revenue and invested more money into their stores than Amazon did, but they didn't win because ultimately they didn't execute as well. Amazon was helped by being online early, it gave them the experience necessary to build into what they became, but it's a stretch to claim they had first mover advantage.