What factor makes the external shape of a nematode (roundworm) superficially similar to an earthworm (annelid)?

Answer

Both solve the same mechanical problem with their external shape

Despite having vastly different genetic heritage and internal anatomical structures—a nematode and an earthworm belong to separate phyla—their external resemblance stems from a shared functional necessity. The soft, elongated, cylindrical shape is an extremely effective geometry for navigating loose substrates through peristaltic action. Because both groups utilize this morphology to solve the mechanical challenge of movement and burrowing in low-resistance environments, their external appearance converges, even though their evolutionary paths are separate.

What factor makes the external shape of a nematode (roundworm) superficially similar to an earthworm (annelid)?
biologyevolutionworminvertebrate