I’ve lived in a lot of places where electrical service disruptions were not uncommon. I noticed that sometimes the lights would just go out, sometimes the lights would go out and then come back on for a few seconds and then go out again, and sometimes the lights would go out, come back on briefly, go out again, come back on briefly, and then go out again. It seems to me that when the light just go out they are rarely out for more that a few minutes but ehan when the lights go out, come back on briefly, and go out again they usually stay out for a while (like 10 to 60 minutes). And when they go out, come back on, go out, come back on, and THEN go out again, they usually stay out for a LONG time.
When the lights go out, come back on, and go out again (often repeating several times), it’s probably a recloser operating. A recloser is a special breaker that trips on an over-current (usually some sort of short circuit). A normal circuit breaker just opens the circuit, but a recloser opens it, waits a second or so, and then closes the circuit again. If the over-current persists (for a second or so), it opens the circuit again for a short time, then tries again. The exact on/off time is often adjustable, along with the number of tries before it gives up and stays open (at which point someone has to come out and fix the short circuit, then manually close the recloser).
The idea is that by closing the circuit, it may burn off whatever is causing the short. If a tree branch (or squirrel!) is causing a short circuit, often the offending object can be burned off, and everything’s back to normal. If the short persists after two or three tries, the recloser gives up and stays open.
A recloser might also operate after a lightning strike. If a strike caused a momentary overcurrent, the recloser will open the circuit. A second or so later, it will close the circuit again, and hopefully the overcurrent condition will be gone (since it was temporary from the lightning).