Here's my understanding - feel free to correct.
So you have some HTML, rendered in the browser.
<h1 id="header"> hi. </h1>
and in js, you select that html element and create a DOM element, a special JS object that represents the HTML element.
let h1 = document.querySelector("#header")
you make a change to the DOM element in JS.
h1.innerText = 'NEW STUFF'
The browser reacts to this change, and replicates the change in the viewport - presumably, it changes the source HTML and that triggers a re-render of the whole document.
Question - specifically, How does the browser monitor changes to DOM elements and their properties?
any help is much appreciated.