Torn between its two objectives, China placed a higher priority on preserving the Kim family dynasty. That choice gave rise to a seeming paradox: North Korea gained surprisingly powerful influence over China.