Germinating seedlings know which way is up. Perhaps they just know which way is down. They can not see, hear, taste, smell or feel anything like we can. Nonetheless, they know which direction to extend their first root and stem. One thing that they can perceive is gravity. Gravitropism, which was formerly known as geotropism, is how they respond to gravity, or the Earth that generates it.
Positive gravitropism is why the first root to emerge from a seed extends downward toward gravity. Negative gravitropism is why the first stem to emerge from a seed extends upward away from gravity. Positive is toward. Negative is away. Roots and stems that develop after the first, disperse in other directions in response to other stimuli, but never really forget where gravity comes from.
Once a primary stem of a seedling emerges from the soil, it immediately responds to sunlight. Just as it exhibits negative gravitropism to grow away from gravity, it exhibits positive phototropism to grow toward sunlight. Since sunlight comes from above, positive phototropism is compliant to negative gravitropism. Branches will later disperse laterally to avoid the shade of other branches.
While branches are finding their way in the World, roots are doing the same. All of them can not always reach for the center of the Earth. They branch and disperse laterally as they sense that they are sufficiently deep in the soil. Those that venture too deeply sense an inhibition of gas exchange. Those that are too shallow sense if they get too warm or dry. There are a few types of tropisms.
Roots respond to moisture, nutrients, chemicals, temperature and mechanical stimulation within the soil. Branches and foliage respond to humidity, wind, temperature variations and air pollution. In order to function within their dynamic situations, plants somehow coordinate their responses to all of the many stimuli they experience. They are impressively perceptive, as well as responsive.
Even celery, green onions and leafy tops of carrot in a refrigerator can reach upward away from gravity.