Corals are animals that belong to the phylum cnidaria, like jellyfish and fire corals. For 400 million years, corals have been successful evolutionary competitors. There are many different types of corals, including soft corals, sea fans, and stony corals. The modern stony corals, the scleractinians, have existed for around 240 million years. There are currently 25 families and about 1500 species of stony corals. Most live in colonies consisting of hundreds to thousands of genetically identical, interconnected tiny polyps. Together, they form a skeleton through accretion of calcium carbonate. These massive calcareous structures build up what we know as a coral reef.
Corals have a simple body plan (coral anatomy by NOAA). An inner and an outer cell layer form an enclosed space, the gastrovascular cavity, where the coral's prey is digested. As sessile organisms, corals filter the surrounding water with their tentacles subsisting on plankton and organic matter. However, they do not rely on these food sources alone. Most tropical corals live in symbiosis with unicellular algae called zooxanthellae. The algae contribute essentially to the corals’ nutrition by transferring photosynthetically derived metabolites to their coral hosts.
Coral reefs are highly productive ecosystems hosting a high diversity of species, but apparently thrive in a nutrient poor environment. Charles Darwin already puzzled over this intuitively contradicting facts, which became known as Darwin's Paradox. This mystery, not truly unraveled yet, can be explained by the close coupling between organisms and functional groups, enabling an effective recycling of matter and nutrients within the coral reef ecosystem. That means, the coral reef ecosystem is self-perpetuating.
One clear example of this coupling between organisms and functional groups is the relationship between corals and their symbiotic algae. In a world where there is tremendous competition for space, and predators lurk everywhere, the coral host gives shelter to the zooxanthellae and fosters their photosynthesis with the corals’ metabolic waste products. The algae, in turn, supply their host with sugars and amino acids, often meeting most of the coral's needs. Thus, this symbiosis not only connects the functional groups algae and stony corals, in particular connecting photosynthetic energy conversion directly to animal metabolism, but it also ensures an efficient recycling of nutrients within the reef ecosystem.
You can read more facts about corals and reefs at NOAAs coral 101 (US National Ocenanic and Atmospheric Administration, coral reef conservation program) or at Nature.com's knowledge project about coral reefs.