How do trees know which direction to grow to balance themselves so they don’t fall over?
They don’t - not always. Trees may fall over if they grow unevenly due to environmental factors such as insect attack or prevailing weather.
But most trees don’t fall over - this is probably for several reasons, including:
Physical makeup: They’re made of strong stuff, rooted into the ground. Even if they are slightly overbalanced, trees can remain standing.
Evolution: They generally grow in a symmetrical arrangment because that’s what their ancestors did, all the way back to the point where they weren’t trees. If at any point a mutation occurs to make something freakish and unbalanced, it will probably not be as successful in producing offspring as its peers - so it dies out.
**Plant anatomy and development: ** Plant growth is regulated by hormones - these are distributed around the plant in such a way that they tend to stimulate new growth adjacent to damaged tissues - so if you cut off a twig, it interrupts the flow of hormones in such a way as to stimulate a nearby bud to sprout and grow a new twig that more or less replaces the one you cut off.
After you read that, look up phototropism.