Understanding the dynamics of the frequency bias in neural networks