The rise of generative artificial intelligence has been breathtaking, and American firms are leading the way. But rivals like China are gaining ground, with major consequences for the U.S. economy and national security, write Sebastian Elbaum and Adam Segal.