In-Universe:
The Defiant shuttlepod raises a subspace field around the comet fragments to seal them from contaminating the wormhole.
Production:
The shuttlepod is a physical studio model and was never created in CGI. The comet fragments are also a physical prop.