This is a pun on the phrase "struck me", which usually means when you finally undersand something. It's being used here because lightning can literally strike you too
I was struggling to figure out how lightning works then it struck me .