Q:

ELI5 how does React Hooks know when to update the DOM?

I've read Hooks at a Glance and I understood why:

Hooks can be declared only at the top level
Hooks names should start with use

But they don't talk about how the render engine gets updated. Is it the same as with classes? If yes, how do they "bind" the state and trigger a DOM update?

A:

Read this article by Dan Abramov: overreacted.io/how-does-setstate-know-what-to-do. As he states in it: 

"When people first look at the Hooks proposal API, they often wonder:
  how does useState “know what to do”? The assumption is that it’s more
  “magical” than a base React.Component class with this.setState(). But
  as we have seen today, the base class setState() implementation has
  been an illusion all along. It doesn’t do anything except forwarding
  the call to the current renderer. And useState Hook does exactly the
  same thing."

