It does run through every node in the would-be scene graph by default, but IIRC the Dear ImGUI library caches the actual expensive toolkit, graphics, and/or window system calls for each subtree. The API is immediate-mode, but its implementation does not have to be stateless. (Cf. React.)
I wish the article detailed the performance issues with the old implementation, and why those issues necessitated a rewrite (other than "strong primitives" and "difficult to retrofit").