How do I avoid the HTML I enter is altered?
It's probably not just CKeditor altering your HTML. You should look into the configuration of your input formats at /admin/config/content/formats. There is documentation on https://www.drupal.org/docs/8/core/modules/filter/overview, although it's not very detailed.

An input format applies one or more text filters to your input. Common filters are the HTML Filter, that allows only a limited number of HTML tags, and the Line Break Converter, which turns line ends into &lt;br&gt; or &lt;p&gt; tags. You can configure your input format, or create a new one, without any filters.

If I recall correctly, even if you don't have any text filters configured, Drupal may still strip some HTML tags that are considered particularly dangerous, like the &lt;script&gt; tag.