Tl;dr lightings may be caused by electrons/positrons from outer space hitting a cloud and initiating an "avalanche" of electrons.
Cosmic rays are mostly protons, not electrons or positrons. You're mixing up to separate theories in the article.
Much of the time they occur when two weather fronts of different temperatures collide with each other.
Cosmic rays are mostly protons, not electrons or positrons. You're mixing up to separate theories in the article.