Solenoid switches are used on various aircraft types. They can function in many systems, but they're found being used in Auto-Pilot and Ground Service applications the most often.
The switch should be considered basically as a relay, but one that has to be manually switched on.
Internally, there is a holding coil used to maintain the switch in the "on" position. Voltage to this coil is present when a "valid" signal is output from the controlling circuit.
As a couple examples:
A manually engaged Yaw Damp System switch. When the crew flips the switch on, it will remain on as long as the valid signal from the controlling computer (Stab Aug on many older aircraft) is present. If for any reason (let's say a rate gyro takes a dump), the computer and/or system is no longer usable. The valid signal is removed and the switch falls to the off position.
For aircraft ground service circuits to function, proper GPU (Ground Power Unit) voltage, frequency, and phasing must be sensed by the aircraft. If GPU output is correct, the ground service switch will remain engaged when it's switched on. (On commercial aircraft, the switch remains on no matter what power source the crew is using. As long as the cart is connected and outputting, the ground service switch stays on. If the noise level is low enough, you can hear the switch drop when the GPU is turned off. Is the flight-line "ever" this quite? Do most older mechanics still have the hearing ability to actually hear the switch drop?)
The valid that maintains the switch on can be either voltage or a ground. Coils don't care. As long as both are present the coil stays energized. Removing either the power or ground will de-energize the coil and the switch will fall off.