Joseph Dwyer, a professor of physics and space sciences at the Florida Institute of Technology, has been wondering the same thing.
Your question lies at the core of one of science's great mysteries: What causes lightning? Decades of electric field measurements made inside thunderstorms have failed to find large enough electric fields to cause a spark, even when the effects of precipitation are taken into account. Since we know that lightning does occur—in fact, it strikes the earth about four million times a day—we must be missing something in our understanding.
A mechanism proposed by Russian physicist Alex V. Gurevich of the Lebedev Physical Institute and his collaborators suggest that the movement of large showers of energetic particles produced by high-energy cosmic rays—which originate from exploding stars halfway across the galaxy—might provide a conductive path that initiates lightning. There are indeed types of particle detectors called spark chambers that exploit this principle. In a spark chamber, a very large voltage is applied across a small gap filled with a gas. The resulting electric field is large enough to cause the gap to break down (or spark), so long as there exist some free electrons to get the whole process going. Think of loose rocks ready to fall down the side of a mountain. In order to get an avalanche going, all that is needed is the first moving rock. Similarly, when a charged particle (the first rock) passes through the gap, the ionization it leaves behind will cause a spark, which more or less follows the particle's path. For these kinds of detectors, the location of the spark can be used to identify when and where the charged particle went through.
On the other hand, the case of thunderstorms and lightning is slightly different. Unlike the spark chamber, the electric fields inside the thunderstorm do not appear to be big enough to initiate a spark, so in order for Gurevich's mechanism to do the job, he had to suppose that there were many, many charged particles passing through the storm at once. Because cosmic-ray air showers do not produce enough particles by themselves, Gurevich postulated that the thunderstorm gave the cosmic-ray shower a boost by increasing the number of energetic electrons through an exotic process called "runaway breakdown."
Runaway breakdown occurs when the drag force that electrons experience moving through air is less than the electric force acting upon them. In such cases, the electrons will "run away," gaining very large amounts of energy. As the runaway electrons collide with air molecules, they generate other runaway electrons plus x-rays and gamma rays, resulting in an avalanche of high-energy particles. Instead of rocks in a landslide, think of the runaway electrons as shrapnel tearing up a path through the storm cloud. According to the Gurevich model, this conductive path is what causes lightning.
Runaway breakdown can create large amounts of high-energy electrons, as well as x-rays and gamma rays. Interestingly, we know that runaway breakdown works for the low electric fields already seen inside thunderstorms. We also know that it does sometimes happen right before lightning, because we can see big bursts of x-rays and gamma rays shooting out of thunderstorms. In fact, these gamma rays are so energetic and so bright that they have been observed from outer space, 600 kilometers (373 miles) above Earth's surface.
So, does all this add up to cosmic rays as the cause of lightning? No one can be sure at present.
Some researchers, including myself, have voiced skepticism about this mechanism, due to a few technical problems. For example, for lightning to propagate it must form a hot, conductive channel. This channel acts like a metal wire, allowing very big electrical currents to flow. It is difficult to understand how a large, diffuse discharge produced by an air shower and runaway breakdown could result in such a hot channel measuring just a few centimeters across. Alternative explanations of lightning initiation have been proposed, including some that involve a conventional breakdown from water and ice particles, as well as others that involve differing forms of runaway breakdown without cosmic rays. Scientists are busy working on models and experiments to test the validity of all these ideas.