WEB APIs like a DOM are not a part of built-in JS objects, so how it is possible that I can use them without importing them? What inner mechanism is responsible for that?
They are builtins, provided by the environment. They're just not native EcmaScript objects, they're host objects.