Complex sentence: It favours reef flats where it is not fully exposed to the waves but the water is well aerated, and shallows beside slabs of rock from under which cool water wells out when the tide retreats.
Split into simpler sentences: It favours reef flats where it is not fully exposed to the waves but the water is well aerated. It also favours shallows beside slabs of rock from under which cool water wells out when the tide retreats.