Kraft Heinz is investing $400 million on a highly automated distribution center west of Chicago that the company says will be one of the largest in North America for consumer packaged goods, a move that shows how companies are upgrading their logistics processes.