Static electricity is a condition that forms when electrons from one mass of atoms (in an insulator) are transferred to another grouping and an opposite charge is formed with the potential for a strong additional transfer to easily to atoms ready to accept this charge and pass it along (as what happens in conductors). Though despite the fact that this electron transfer is ongoing and a constant natural occurrence, why are there only some times that seem to generate the static and not so much others? This is because of the causes of static electricity that favor the event.
Anyone familiar with the dry air of winter knows that when they scuff their feet across the carpet and touch something metal, they'll likely receive a static shock. However, if they repeated this sequence of events in the summer season, they would probably feel nothing at all. Likewise - yet opposite - they might witness the static buildup and release in the summer atmosphere known as lightning, but come winter, see no lightning activity whatsoever. The main cause is the dryness of the air.
The air under our feet, in the room, and in the atmosphere is a poor conductor of electricity. By itself, the air doesn't have any appealing properties to electrons that would urge them to transfer over, thus very few are willing to leave certain objects that have accepted them, at least until they find a better home. This is why shuffling feet over a carpet produces static electricity, because the air prevents the siphon of electrons from our body. However, the summer air doesn't allow this to take place. That is because the summer air has moisture in it.
As water is a very good conductor, this explains why winter air over summer air allows for room-based static buildup, but does nothing to explain lightning, which occurs in the summertime when the air is wet. This is because the air isn't as wet as it is thought to be, and the secret lies in the clouds, and the fact that they aren't made up of water, but ice. Also, clouds are kept aloft by thermal currents that arise from the sun-heated surface of the planet and push the clouds higher. This explains why winter clouds are comparatively lower than summer clouds. It's this height that directly influences the production of lightning.
Lightning forms as a result of the thermal currents pushing the clouds very high into the atmosphere, where the air is much colder - thus drier. Here, the rising and falling of the ice crystals shed electrons off within the clouds during the many collisions occurring within the cloud layer that is very cold, thus storing the charge within the bottom portion of the cloud while the opposite charge is centered on the topmost part of the cloud. When this charge becomes too great, it moves across the insulator/dielectric air and contacts the ground, where it is absorbed. This dielectric breakdown is lightning.
Lightning does not form in most winter storm systems because there are not enough thermal currents to create the needed friction to amass the charge. That is why lightning occurs in the summer and not the winter, with 'dry' being the cause for static electricity build up.