Coral reefs are built by coral polyps as they secrete layers of calcium carbonate beneath their bodies. And inside each coral poly lives single-celled algae called zooxanthellae. So basically in simplistic terms, coral polys create coral reefs and algae is in coral polys which also goes into coral reefs when they are made.