A solenoid is an electromagnetic switch that safely connects the battery to the starter motor when the engine is started.