The president’s calls for peace and willingness to exert military power can at times feel like competing impulses.