The world’s biggest retailer is investing to strengthen its competitive advantage