how does a magnetic contactor work