In the lost wax casting process, it is fairly easy to produce multiple pieces in one casting. The wax models of the pieces are connected together with sprue lines, allowing molten metal to enter through the spaces created by burning out the wax after investment casting and flow between the resulting molds of the individual pieces.
Treeing is also used for injection molding of plastics. Ever assembled a model kit? You probably had to remove the individual plastic castings from the sprues during construction.
The tree must be constructed in such a way that no air pockets can be trapped, and metal (or plastic) will be able to flow everywhere it should during casting.