Earth has a charge of -1.6×10^-19C or about 7 moles of excess electrons on it's surface. This is compensated by an equal deficiency of electrons in the earth's upper atmosphere. Earth is also an infinite source and sink of current. Now, when current flows into it, that means it loses electrons. So, to create balance, the upper atmosphere should also gain the same amout of electrons. How does that happen?