While tree roots do grow towards moisture, it's not a simple case of them actively seeking out water sources. Roots grow in all directions, but they grow more rapidly and extensively in areas where they encounter favorable conditions, including moisture.
Roots have specialized cells called 'root hairs' that absorb water and nutrients from the soil. These root hairs are more abundant in moist soil, so roots naturally extend more in those areas. However, roots also need oxygen to survive, so they will not grow into waterlogged soil. The direction of root growth is influenced by a combination of factors, including moisture, oxygen availability, soil nutrients, and the tree's overall health.