I bought my boat in Panama in 2019 and it sat on a mooring there for 2.5 years through innumerable thunderstorms without being hit, let alone its previous five years there, along with many other boats in that marina and elsewhere in Panama. But I met three boats that were hit, and have followed the saga of the catamaran Parlay Revival on YouTube that got hit at anchor near Panama City a few years ago and then again recently in Costa Rica, each time suffering major electronics damage. I am not convinced there is any way to avoid or prevent a lightning strike, but when crossing Panama Bay one night got enveloped in a massive set of thunderstorms so wrapped all electronics in many layers of heavy tin foil and put them in the oven as the bare minimum, plus disconnected my VHF and chartplotter. I believe my mast is grounded to the big zinc bolted to the hull, but not sure (should ask Pacific Seacraft), but I also have a heavy-gauge set of car battery cables that I put one on each upper shroud and the end in the sea. All probably useless in case of a direct strike, but possibly helpful in case of a streamer or nearby strike. Then I sat in the companionway as far from metal as possible for several hours.
All by way of introduction to this article in NYT on a remarkable study of strikes filmed in Brazil. Of course we have long known of the positive streamers generated from the ground by intense thunderstorm clouds overhead (I have even experienced the standing-up-hair phenomenon while hiking in mountains in a storm), and that a strike usually connects to one of them, but these guys caught it all with a ultra-highspeed camera that takes 40,000 images per second, allowing literal millisecond analysis. There is a vid in the article and the paper linked below has more detail. Amazingly the final strike took a 90 degree turn as the connection to a streamer from a chimney was made, even ignoring a nearby higher lightning rod. Scary stuff.