Militaries worldwide are grappling with breakneck technological change and the lessons from Ukraine and the Persian Gulf.