Have you ever touched a metal doorknob with your hands and gotten shocked? If that's happened, you've created an electrical discharge between your body and that very doorknob. Our own bodies are capable of conducting electricity (thank you Tesla) in the same way that a thunderstorm does when creating lightning.
Lightning occurs when there's an electrical discharge around a thunderstorm, whether it be between the cloud and ground (or another object), or within the cloud. Generally, there's a negative charge at the base of a cloud that gets attracted to the positive charge at the ground. When the attraction is strong enough, the current connects and forms lightning.
The most common of these is the cloud-to-ground lightning strike. What is interesting to note is that although it appears that what we see is a strike going from the cloud to the ground, we actually see the opposite. The negative charges at the base of a cloud attract to the positive charges in the earth, so they fall towards the earth in a formation known as the "stepped leader." Once contact is made at the surface, we see a return of light beginning at the ground and moving upwards known as the "return stroke." Since the strike overall is so fast, we see the more bright return stroke instead of the stepped leader. In this video, you can see the process in which the stepped leader moves downward while the return stroke is the brightest part of the strike.
Another type of lightning is ground-to-cloud (also known as upward lightning), which is more commonly used to describe a negative charge on the ground that is being attracted to a positive charge in the cloud. This usually occurs with some sort of object on the ground (i.e. buildings, wind turbines, isolated mountain tops, etc). With this type of lightning, the flash that we see also goes up in the form of a strongly lit stepped leader.
Still a cloud-to-ground lighting strike, however a bolt from the blue gets its own category as it originates from the highest region of a cumulonimbus cloud. This type of lightning is unique in that it first travels horizontally away from a thunderstorm before making its decent to the earth, which can be up to twenty miles away from the storm cloud. These can appear to occur in locations under clear, blue skies, which leads to the term 'bolt from the blue.'
Anvil crawlers are a horizontal, in-cloud lightning discharge that typically appears slower-moving to the human eye. These high-altitude events often travel long distances, covering the entire sky. Because of their great distance from the observer, the sound of thunder is very soft.
Triggered by the discharge of positive lightning in an underlying thunderstorm cloud and the ground beneath, red sprites occur well above a cumulonimbus cloud. Typically reddish in color and not your typical lightning bolt structure shape, this form of lightning lacks the same type of heat that the more common 'below cloud' lightning contains.
Blue in color, blue jets project from the top of a cumulonimbus cloud, usually in a cone-like shape, upwards towards the outskirts of the atmosphere (comparable to the "jet" of an airplane).
Each lightning strike goes through a decaying stage that breaks the channel into segments, giving the rod a look similar to stringed popcorn. This particular stage, known as bead lightning, can sometimes be more prominent and appear to last longer, making it seem like its own form of lightning, but in actuality, it's part of the lightning process.
A rare phenomenon that has been described as an illuminating sphere that floats during thunderstorms, often with randomized movement and sound. This particular type of lightning only exists by word of mouth as there is no photographic proof.