well, the way a MS works is that by electric fields the compounds are made to bend away from traveling in a straight line. The heavier the compound the bigger the radius of the curve will be.
But, in order to make the compound bend under the influence of an electric field the compound has to be charged of course. (neutral compounds would just travel straight) In other words the compounds have to be ionized first.