Relationship with Sandworms
Sandtrout existed in vast numbers in the sands of Arrakis. Many would die as part of the natural life cycle of the planet; the ones that survived would eventually grow, over a period of thousands of years, into the giant sandworms that lurked in the depths of Arrakeen sands. If squeezed, they excrete an extremely potent form of spice which gave one an incredible energy boost. Also, children in Fremen sietches would play games with them to entertain themselves, such as using them as gloves, or attaching them to sticks.
Sandtrout had the ability to transform a whole terraformed planet into desert by encapsulating large bodies of water, allowing the Sandworm to survive, since Sandworms cannot survive in a water-logged environment.
When Leto Atreides II looked into the many lives of his ancestors in Other Memory, he came to realise that the sandtrout were introduced to Arrakis from another planet, eons prior. According to Leto, the sandtrout had proliferated to the point where existing ecosystems could no longer deal with them. Arrakis had been a wet planet, and when the sandtrout arrived, they encysted all the water, so that they could evolve into the sandworm. This was consistent with the physical evidence that could be found on Arrakis, namely salt beds that had apparently once been great seas.
Leto Atreides II
As part of his Golden Path, Leto allowed several soundtrout to attach themselves to his body, so that he could turn himself into a giant Sandworm. The absorption of the sandtrout onto his body acted as a second skin, as well as provided him with immense speed and strength. The first sandtrout formed a glove over his hand, and the next ones linked to it by their cilia until most of his body was covered. Leto managed to live through the metamorphosis because his blood was spice-concentrated and this led the sandtrout into thinking it was water.
Over time, Leto's body gradually changed into that of a sandworm, a process that took 3500 years. The sandtrout transformed Leto until his metabolism and biochemistry were a hybrid of human and Sandworm. However, he also modified the trout in the process, making the resulting sandtrout tougher and more adaptable, allowing them to be settled on other worlds. Thus he ensured the survival of the sandworm species. Leto also imparted some of his own DNA and genetic memories into the sandtrout that emerged from him when he died, and thus into the sandworms that evolved from them.