Walmart is investing heavily in automation and e-commerce. The key question is whether those investments will lift its return on capital, or simply defend market share.