As tariffs and costs fluctuate, Walmart fine-tunes production and pricing to keep shelves stocked and shoppers satisfied.