There isn't one single cause. Sometimes they watch the pitch long enough to know they got the bat on the ball, and start looking for their awesome hit. Oops......foul ball. Sometimes their head never goes down in the first place, and then goes with the bat.
In my experience, it seems like as often as not they pull their head when they are really early and can't stop the swing.
Pulling the head is usually a result of the front shoulder rotating away from the plate too soon. Tell her to take the front shoulder down and and inward then learn to use the hands and lower body to swing the bat
Maybe have her focus on maintaining a power V with the back arm and keep the hands near the rear shoulder until launch
Think about the angle of the neck, think about the Angle of the spine.
It will be uncomfortable to pull your head with the proper angle.
Hold your tilt.
Hold your spine angle.