The slits do their most basic job here: water drawn in at the mouth passes through the pharynx and out through the slits, leaving particles behind. Gas exchange happens across the surrounding tissue. In vertebrates the same embryonic structures were elaborated into gills, and in mammals into jaw, ear and throat components.
The shared ancestry is not just anatomical. Genes patterning the acorn worm's body along its front-to-back axis are broadly the same set, in broadly the same order, as those patterning the vertebrate nervous system, even though the acorn worm has a nerve net rather than a single dorsal cord. The genome of Saccoglossus kowalevskii has been sequenced and supports the deep homology.
What this does not mean is that acorn worms are ancestral to vertebrates. Hemichordates are a sister group to echinoderms, and both together sit beside the chordates within the deuterostomes. Whether the last common deuterostome ancestor was a burrowing worm or a free-swimming filter feeder is still argued, and the acorn worm's own nervous-system homologies are part of that argument.

![Photograph of Acorn Worm: 1. Ptychodera clavigera [currently Balanoglossus clavigerus], von der dorsalen Seite. 1/1. Nach dem Leben. 2. Ptychodera minuta [currently Glossobalanus minutus] q 1 , von der ventralen Seite. 2/1. Na](/_next/image?url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Ff%2Fff%2FEnteropneusta.png%3Futm_source%3Den.wikipedia.org%26utm_campaign%3Dimageinfo%26utm_content%3Dthumbnail_unscaled&w=3840&q=75)