The turbulent wind environment of a thunderstorm with its updrafts and downdrafts is an ideal environment to separate electric charges: negative charges generally gather near the base of the cloud, while positive charges build in the upper reaches of the cloud. This allows electric fields to form and grow between the cloud and the ground and within the cloud itself - all necessary conditions for lightning to occur.
Since similar-charged objects repel each-other and opposite-charged objects attract each other, negative charges then begin to spread out near the base of the cloud. At the same time, positive charges start to build underneath the storm. This region of positive charges travels underneath the cloud, almost like a shadow. The positive charges tend to concentrate on tall objects, like trees, poles and buildings.