Could be as simple as the old “no leader is as popular as a war time leader” but.
See also: Argentina and the Falkland Islands. Every so often, an Argentinian leader starts rattling his sabre over the Falklands to drum up support at home, despite the islands population being overwhelmingly in favor of staying British.