Roots are what support and anchor the tree. They also give it water and nutrition from the soil which is important for the tree to grow and be healthy. You could not have a tree without roots. Another function of roots is to store food and nutrients for plants.
The roots keep growing until they find what they need, like water. They grow just like any other part of a plant, or how we grow based on their DNA.