This illustration demonstrates the charge separation that goes on within a thunderstorm which leads to lightning.  Strong updrafts within the thunderstorm force moisture into colder portions of the atmosphere where supercooled water droplets, graupel (like snow pellets or small hail), and ice crystals form.  What happens next is still being studied by scientists, but it is believed that when the ice crystals and graupel collide, electrons are transferred from the ice crystals to the graupel (the same process that charges your body when you walk across carpet or rub a balloon on your head).  This gives the ice crystals a positive charge, and the graupel becomes negatively charged.  The heavier graupel and water droplets become concentrated at the bottom of the cloud, while the lighter ice crystals are kept higher up by the storm's updraft.  This produces a charge separation within the cloud.  Additionally, the negatively-charged cloud base repels electrons at the earth's surface, and the ground becomes slightly positively charged.  This electric field results in an electrical discharge (lightning).  This can be within the cloud or from the cloud to the ground.