The British colony of New Zealand became an independent dominion in 1907 and supported the UK militarily in both world wars .