How Graph Neural Networks Learn: Lessons from Training Dynamics in Function Space