When the current is switched on, the coil is magnetized and attracts the metal projectile causing it to move down the barrel. If the current remained on, the projectile would move to the coil and then stop. Turning off the coil allows the projectile to continue travelling down and out of the barrel.