Here's why:
* Cathode rays are streams of electrons. Electrons are charged particles.
* Magnetic fields exert a force on moving charged particles. This force is perpendicular to both the magnetic field and the direction of motion of the charged particle.
By applying a magnetic field to the cathode ray tube, Thomson observed that the rays would bend, confirming their charged nature. He was then able to measure the deflection and calculate the ratio of the charge to the mass of the particles, which provided crucial evidence for the existence of the electron.