I worked at Amazon, as an executive, for a decade, but not in transportation or supply chain, and learned a ton. I can share some basics but I have to be careful about what I say. Here is public (ish) information:
Amazon maintains real time inventory and supply chain planning. Packages can be encumbered for delivery at the factory. Forecasting predicts how many of each item to send where in the country to minimise transport with very high accuracy. Amazon forward deploys high volume and popular items to all major cities to minimise transport distances. Amazon turns over all inventory ten plus times a year (B&M do 1-3 on total inventory), meaning that the cost of goods is low as you add very little (floor space x time) holding cost. Amazon owns a large percentage of transportation including the final mile. Amazon does so much volume with UPS, USPS, etc that it can negotiate incredible rates and aggressively works to be tolerant of the loss of any supplier (transport or otherwise) to keep market forces at work with their service suppliers. Amazon obsesses over operational metrics to a level of detail and attention that is actually scary to human beings in there outside world.