Lightning, with no e in the middle, is the electrical flash in a storm. Lightening, with the e, is the present participle of lighten — making something lighter in weight, colour or mood. The e is the whole difference and it marks the verb.
The core difference
One is a noun naming a weather event; the other is a verb form meaning "making lighter".
- lightning — the flash: struck by lightning, lightning storm. Also an adjective meaning very fast: lightning reflexes.
- lightening — from lighten: lightening the load, lightening her hair, the sky was lightening.
Why the spelling dropped its e
Lightning was once written lightening — it is historically the same word, from the flash of light. The spellings separated so the weather sense could be distinguished from the ordinary verb, which is a rare case of English tidying itself deliberately.
The test
Substitute "making lighter". If it fits, keep the e. If you mean the thing in the sky, drop it.