Why is it that instructions for using car jumper cables go to great pains to insure that you don’t create a spark near the battery, but if you install a new battery the instructions acknowledge there will be sparks that are unavoidable?
A spark around a warm or hot battery (from charging by a charger or another running car) can cause the battery to explode. As batteries are charged they can produce hydrogen gas which in the right concentration can be highly explosive. It has been estimated that an exploding battery can generate as much explosive power as three sticks of dynamite.
Here’s the rub with batteries, even most “sealed” batteries are not sealed in the sense you might think they are. They are sealed to the extent that they have check valves that prevent the escape of gasses during normal charging but during periods of over charging these control valves allow some escape to prevent a too high internal battery pressure. So most batteries can generate enough hydrogen gas to become explosive under the proper circumstance.
During jumping (which I would never do. You can do every step 100% properly and still damage one or both cars or blow yourself up) the charge rate may be largely unregulated and cause the battery to become overheated which in turn can cause hydrogen gas to escape.
Because hydrogen gas is explosive in the right concentration both booster cables should never be connected directly to the discharged battery (the car has failed to start through multiple attempts and the booster cables have led to higher temps). Consequently the final booster cable connection should be made at the car with the dead (and hot) battery. This is also the first cable to be removed.
But, that final booster cable connection should be made at a clean metal part of the engine as far away from the battery as possible, never to the battery itself. When that final connection is made there will be a spark and you want that spark as far away from any hydrogen gas as is possible to minimize the possibility of explosion.
When installing a battery it will not normally be overheated or be in an enclosed space where hydrogen gas can collect. Therefore, although there will be a spark when the final connection (negative cable) is touched to the battery post it is far less likely to cause an explosion. But there are instructions in the vehicle service manual on how to protect one’s self from the effects of an exploding battery and these instructions should be closely followed.