The balls (bearings) wear a groove into the green cup (outer race) and in the star (inner race). As the bearings slip into & out of the worn grooves, that's what causes the clicking sound.

http://en.wikipedia.org/wiki/Cv_joint

has an animated graphic that'll help you to see what's going on.