Essentially Amazon invested in being the world’s best logistics, warehouse and inventory management company. In the early days this is expensive because the logistics & warehouses are amortized over a small customer base but with scale this infrastructure and the technology that drives it becomes a powerful moat and hard for new entrants to compete.
If you buy that Amazon is a tech startup then essentially you’ve already answered the question. Amazon took a consumer value proposition (buying books, then all retail products) and made the consumer experience significantly better, faster & cheaper. They didn’t do this by selling better books or electronics, they did it by building a logistics & warehouse powerhouse.