Lightning occurs when two clouds crash into eachother.
As you may know clouds are big groups of wat gas moleculs. When two clouds crash (usually happens when there's alot of wind) the two gas clouds crash in eachother creating electricity.
As there is nowhere for the electricity to go the electricity goes to the earth to the closest point possible.
That is why electricity always strikes the highes point and that is also why you should never be out in a field when there's lightnight.