Most corals are colonial animals. This means that the individual coral polyps that form coral are still connected and share nutrients. A coral colony starts with a single coral polyp settling on the seafloor. As it grows and forms its calcium carbonate structure, it starts to divide in a process known as 'budding'. This is a type of asexual reproduction.
Once the coral polyp has divided in two, both new polyps stay connected. In this photo, you can see an example of staghorn coral, created over many years of individual polyps growing and dividing and continuing to grow their hard calcium carbonate structure at a rate of 10-20cm a year. It may look like a tree, but is in fact made up from many tiny individual animals.