Amazon does not make any money retailing either.
Amazon took their largest cost center, IT infrastructure, and made it a profit center (AWS). That is the part that makes money.