The fates of the U.S. economy and millions of retirement accounts are entangled with a giant bet on artificial intelligence by leading tech firms.