What minifying removes
HTML browsers treat any run of whitespace between tags as a single space, so the line breaks and indentation that make source readable add bytes without changing the page. Minifying removes HTML comments and collapses that inter-tag whitespace to produce a smaller, faster-loading document.
The minifier strips <!-- ... --> comments, collapses multiple spaces to one and removes whitespace directly between adjacent tags - all changes a browser cannot see in the rendered output.
Worked example
An indented block collapses to a single line:
<div> with comments, line breaks and four-space indents.<div class="box"><h1>Hello</h1><p>A short paragraph.</p></div>What it protects
Some whitespace is significant: text inside <pre> and <textarea> renders literally, and the code inside <script> and <style> can break if spacing changes. The minifier detects those regions and leaves them untouched, collapsing whitespace only where it is safe. Everything runs locally, so your markup never leaves the browser.