A permanent magnet has a magnetic field. If an electron (or other charged particle) is moving through a magnetic, it will feel a force. This force is called the Lorentz force and you can read more about it here: http://en.wikipedia.org/wiki/Lorentz_force