How does lightning form?
Lightning is a powerful atmospheric electrical discharge. It can occur within a cloud, between clouds, or between cloud and ground. Electrical charge is not distributed uniformly throughout a thunderstorm.
Charge separation and discharge channels
Interactions among ice particles, supercooled water, and storm air motions help separate charge. Strong electrical fields can ionize air locally and develop branching channels. Cloud-to-ground discharges may connect descending leaders with upward streamers, followed by a bright return stroke. One visible flash can contain multiple strokes, and polarity and channel form vary among discharges.
Observation and safety
Lightning can strike away from the heaviest rain. Rubber soles or a small shelter do not provide reliable protection. Hearing thunder is a reason to seek a substantial enclosed building or suitable enclosed vehicle rather than a lone tree. Forecasting requires meteorological context, radar, and electrical observations, not a single photograph of the sky.