Japan and Germany’s expanding defence cooperation reflects a shared effort to adapt to a more uncertain security environment.