Many people wonder why, when you are out snorkeling or diving you can see different things on different parts of the reefs. One section can be covered with green wrasses and yet 20 feet away there isn't a fish of any type to be seen. There may be sea sponges by one type of coral, but when you find the coral growing somewhere else, no sponges to be found. Is there a reason for species diversity in different areas of a reef? There is always a reason for everything in nature.
Some reasons are easily apparent, such as sheltering rocks. The fish may have found rocks or holes in the reef. Rocks and holes may not sound like much but they can make a big difference to many species. The right size ion from predators and a place to sleep safely. The wrong size and shape can mean predators! If you see a hole with shells nearby, there is likely and octopus, and no fish!
Another reason that should be apparent but often isn't is food supply. There are several different types of sea weed or grass and they often require specific bottom or current conditions to flourish. That bottom type may only be found in one particular area of the reef. Little fish eat the grass and then bigger fish eat the little fish, but you only see the big fish and wonder why the stay near the grass if they are carnivores.
Then there are also long-term weather patterns and currents to be considered. One area of the reef may get slightly more silt, for things that like silt, this is good. This is partly food, but the current patterns can also effect oxygenation of the water, and that effects the reef. A three mile per hour current may be great for some species, giving a balance of oxygen and nutrient, but a 5 mile per hour may be too much, and habitat and ecosystems are all about balance.
Lighting can have an effect and that shifts throughout the day and the year. Fish see in certain light conditions, so will move from location to the next throughout the day, and to different reefs during the year. In the spring there will be one type of fish and in the summer something different.
And that is what makes life on the coral reefs interesting, diversity and surprises. If everywhere had the same things, you would quickly get bored!