Until the 21st century, we didn't know that lighting bolts - gigantic lightning bolts - could shoot out of cloudtops into the upper atmosphere. We never detected this stunning phenomenon until we watched it from orbit. Ever since, atmospheric physicists and meteorologists have been buzzing about how it works.
Now we think we know. Essentially, one lightning bolt develops in a could but isn't quite strong enough to break out, but its failed attempt clears the upper cloud region of the charges that made it fizzle out. Then a second lighting "channel" develops, and, because the path of least resistance is now upward, it leaps towards space, up to 90km or so, until the charged ionosphere "shorts out" the remaining charge.