in electron impact ionisation, an electron is fired at the vaporised sample using an electron gun, knocking an electron from each particle and giving it a +1 charge
in electrospray ionisation the sample is dissolved in a solvent and pushed through a hypodermic needle at high pressure where a high voltage is applied. this causes each particle to gain a H+ ion.
During acceleration in mass spec, the positively charged particles are accelerated using an electric field. All the particles are given the same kinetic energy.
During ion drift the accelerated ions enter a vacuum. Since they have the same kinetic energy, their velocity is dependant on their mass. Smaller ions will move faster and larger ions slower.
during detection, the detector detects the current created when the ions hit it and record how long it took. this is then used to calculate the mass/charge values