Stars twinkle because of turbulence in the atmosphere of the Earth. As the atmosphere churns, the light from the star is refracted in different directions. This causes the star's image to change slightly in brightness and position, hence "twinkle." This is one of the reasons the Hubble telescope is so successful: in space, there is no atmosphere to make the stars twinkle, allowing a much better image to be obtained.