Let's consider an index of refraction that is frequency dependent.
If $n = n(\omega)$ we see that different wavelengths will have different phase velocities in media. Phase acquired is given by $\delta(\omega) = \frac{n(\omega)d}{c}$
So we are adding phase to components in the frequency domain, obviously phase does not affect our spectrum shape. But, when you get the Fourier transform of the spectrum now those phase components pop up in your pulse shape and we see a broadening of our pulse.
Let's now consider a nonlinear medium. In the model of treating atoms like harmonic oscillators, nonlinearity rises when the electric field oscillations are strong enough to make Hooke's law invalid.

The atom now has an asymmetric response to the field that is time dependent. I.e. we get an index of refraction that is time dependent. With $n(t)$ we see that we introduce phase to the time signal, our pulse shape does not change but, once we get the Fourier transform of the signal we see a difference; I.e our spectrum changes. (Recall we have a real part and an imaginary part in both domains.)
Of course, in practicality, we have to consider both dispersion $n(\omega)$ and phase modulation $n(t)$. So for a dispersive nonlinear medium your index of refraction is dependent on both $\omega$ and $t$, changing the shape in both time and frequency domains.
I am being a little hand wavy, but I hope this helps.