Walmart CEO Doug McMillon retires after 40 years, leaving behind a transformed retail giant that attracts higher-income shoppers through convenience.