How the Coalition pulled off a miracle as Labor's momentum fell apart - and why no one noticed