The lightning forms when water droplets or ice crystals transfer electrical charge between each other, similar to the static electricity which accumulates when you pull a sweater over your head.

When the charge becomes big enough to overcome resistance of the air it will travel to the area of opposite charge, forming a lightning. That other area may be in a different part of the same cloud, or in a different cloud, or on the ground.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence