Clouds are composed of water vapor that has evaporated from liquid water on the earth's surface. The water vapor cools, the higher into the atmosphere it goes, and condenses to form a visible cloud formation.
Inside these clouds, the water vapor continues to move around. The water molecules inadvertently will collide with each other, rub against each other, and strip electrons, which is what electricity is: electrons. The cloud will become charged with the accumulation of charges, positively charged on the top, negatively charged on the bottom. The ground is positively charged as well.
When the negative charges (on the bottom) reach a level that is sufficient to overcome the "gap" between the bottom of the cloud and the ground, the lightning strikes, jumping the gap and completing the electrical circuit from the cloud to the ground. The lightning will strike the tallest object around as it tries to complete the circuit, so don't stand next to anything tall, like a tree. You would be electrocuted as a result of a strike, when the lightning travels down through the tree.