There are actually different types of lightning, including cloud-to-ground (the most common), cloud-to-cloud, intracloud (within a single cloud), and even cloud-to-air.elaborate
Thunderstorms need a significant source of moisture—typically a humid air mass—to form. Without ample humidity, the necessary condensation and precipitation processes can't occur.
elaborate