Final answer:
Lightning occurs when the accumulation of electrical charges in cumulonimbus clouds becomes sufficient to cause a sudden discharge of electricity, either to the ground or between clouds. This is often observed during storms when the electric fields in clouds grow large and become unstable.
Step-by-step explanation:
The phenomenon resulting from the accumulation of electrical charges in cumulonimbus clouds is known as lightning. In storm conditions, cumulonimbus clouds can form with localized electric fields that become larger and may reverse in direction, leading to charge distributions that vary based on local conditions. When the buildup of charge in the cloud is great enough compared to the ground or other clouds, a sudden discharge of electricity occurs, which is the observable event we call lightning. Cloud-to-ground lightning typically happens when a negatively charged cloud base discharges its excess electrons to a positively charged ground. Conversely, cloud-to-cloud lightning strikes imply that the area of the cloud which was struck by lightning had a different charge, often positive, relative to the part of the cloud from where the lightning originated.