The lightning rod crafting recipe is a reward for reaching Foraging 6 in Stardew Valley. During a thunderstorm, a lightning bolt will strike an available lightning rod instead of the farm, and by the next day, the rod will convert that energy into a battery pack.
Stardew Valley: How to Unlock Solar Panels
Battery packs are useful, but storms are unpredictable in Stardew Valley. Fortunately, there's another way to make them.