Was it lucky inventions? Was it mass investment and easing up acess to education? Was it huge government spending on research?
What nations/time periods do you have in mind? This is otherwise an immensely broad question without any single answer.