Walmart and Target were far better than Amazon at logistics at the beginning, but they couldn’t execute (or didn’t focus on) software development as well as Amazon.
Meanwhile, Amazon figured out how to execute logistics just as good or better than the incumbents, giving them the edge to overtake them.