Lightning really is as simple as that.
In and around a thunderstorm cloud there are areas of positively charged energy and areas of negatively charged energy. When the oppositely charged areas are near each other, an electrical discharge of energy travels between them. The cloud areas get their charges as water and ice particles move and interact. Smaller, positively charged particles rise to the top of the cloud, and larger, negatively charged particles gather near the bottom. As soon as the buildup of charge is great enough, the oppositely charged particles attract and discharge their energy as a bolt of lightning.