A lighthouse is in a known location and has a known height. It allows you to identify your present location with great accuracy - the horizontal angle gives direction and the vertical angle gives distance.
If you know your location you can do a much better job of avoiding known hazards.
Thanks! I didn't think about that dimension. The information resolution still feels a bit too low for my liking (I thought it'd help a ship zigzag with precision), but I guess it's much much better than none.
I just realized that if there's 3 of them, it'd constitute an ancient GPS isn't it. Or even only two?
Motor powered ships don't zig zag. Sail powered ships need to tack and gybe to go directly upwind and downwind, but TBH in busy harbours with navigation hazards and a lot of commercial traffic most would furl the sails and use the motor for safety.
You might be interested in "lead marks" which are two signs visible from a distance. They "lead" ships by providing a straight path through difficult passages when the two signs line up. Very simple and effective.
Note that modern lighthouse lights either rotate or blink, the flash frequency is unique and marked on charts to further help identify location at night.
If you know your location you can do a much better job of avoiding known hazards.