Every July, amid festivities and fireworks, the U.S. and France mark their birth as nations. Accustomed as we are in the West to histories that begin with triumph—the signing of the Declaration of Independence, the storming of the Bastille—it may seem strange that China, the fast-rising dynamo of the East, marks the beginning of its journey to modern nationhood in a very different way: with the shock of unexpected defeat and the loss of national greatness.

Many Chinese date the start of their modern history to Aug. 11, 1842,...