as charged objects, ions are attracted to opposite electric charges (positive to negative, and vice versa) and repelled by like charges. when they move, their trajectories can be deflected by a magnetic field.