BEIJING—With a parade of nationwide flags and a last burst of fireworks in the stadium recognized as the Bird’s Nest, China on Sunday formally concluded a Beijing Wintertime Olympics that sought to unify the world but finished up highlighting its divisions.

Athletes competed for medals whilst the menace of war loomed in some of their homelands. The breakout star was not a Usain Bolt-like determine whose athletic feats transcended borders, but instead a U.S.-born Chinese skier, Eileen Gu, whose virtuosity on the slopes was accompanied by queries about allegiance and privilege.