A gradient causes a variation in frequency along its direction, while the sinc-shaped envelope of the RF pulse provides for a box-shaped frequency content. This results in a 90° flip only of those magnetization vectors with frequences within the frequency content of the RF pulse.