The init hook is one of WordPress’s action hooks that runs after WordPress has finished loading but before any headers are sent. It is often used to initialize settings, functions, and resources needed by a theme or plugin.
This uses a filter, which takes an input, modifies it, and returns it.
However, it’s worth noting that dns-prefetch is used to improve website performance, so removing it could lead to slower load times for external resources. Is there any particular reason you want to remove these links?
Cleaning up WordPress head code is a good idea for a variety of reasons. Here are a couple of resources you might be interested in: