WATFORD, England—In public, NATO leaders traded barbs and griped over differences at a two-day meeting here. In private meetings, they patched up rifts and reached agreements on strategic issues and defense initiatives.

Leaders of the 29-member North Atlantic Treaty Organization formally recognized the challenge of China’s rise for the first time. They designated land, naval and air units that can be ready to fight within a month—a central part of the alliance’s response to the threat from Russia.

They...