Typically, the ignition coil in a car generates a high voltage charge, usually in the range of several thousand volts, to create the spark needed for the combustion of fuel in the engine. This voltage is delivered to the spark plugs, which ignite the fuel inside the cylinders. When the ignition is turned on, the coil becomes energized, and if touched, the electrical charge can conduct through your body, giving you a noticeable shock.
It is important to avoid touching any electrical components in the engine bay, especially when the engine is running or the ignition is turned on. Many of the components carry high voltages, and accidental contact can cause serious injuries or even be life-threatening.
If you need to perform any work on the engine, such as spark plug replacements, it is essential to disconnect the battery to ensure the ignition system is de-energized, thereby preventing the risk of any electric shocks.