Why does coral have organized macrostructures?

a lump of coral of any given shape is understood to be composed of a colony of individual coral animals. Coral species produce a wide variety of macrostructures: see for example table coral, brain coral, staghorn coral, and pillar coral, to name just a few out of thousands of species.

It seems apparent that the component animals of a branch, lump, or head of coral must somehow be aware of the overal structure of their comrades around them, otherwise they would not know where to situate themselves so as to form a part of that larger pattern.

So how do they do it? how does any given coral macrostrure emerge from the apparent individualistic behavior of bazillions of individual coral animals?

Naah, no awareness necessary - the structure might arise completely as a result of e.g interacting chemical gradients the polyps put out, without them even being aware that they’re part of a macrostructure, anymore than my individual endothelial cells are aware of the shape of my blood vessel network.

No. They only need to be “aware” of their close neighbors. It is a self-organizing structure such as you can get using cellular automata even with quite simple rules, such as in Conway’s Game of Life. (Most of the example patterns preset in that version produce dynamic patterns of behavior, but you can get static patterns emerging too. Try clearing the grid and then putting a in a row of 7 cells near the middle somewhere: Honey Farm.) The rules for corals will be a bit more complicated than for Conway’s game, and may depend on influences from units a bit more distant than its immediate neighbors, but the principles are the same.

Probably even the development of structures as complex as the human body works in broadly similar ways, but with much more complex rules, of course.

You might want to read up on L-systems, which are very simple rules that can be used to generate seemingly complex shapes.