Planets are closer to us as compare to star and send more light; if some of the light beams are scattered away, others still get through to us, so planets don't usually twinkle. But star is very far away, so we only see a tiny beam of light from it. This beam gets scattered away from our eyes and then back into them almost like it is blinking on and off.