Why does Scots pine growing on sandy soil have a root deep in the soil, while a root system growing in a swamp

Why does Scots pine growing on sandy soil have a root deep in the soil, while a root system growing in a swamp has a superficial root system?

Because plants in arid areas extract moisture deep in the ground, and in wetlands there is enough moisture and it can be obtained on the surface.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.