The layout lives on the active revision: an older active revision keeps its old layout after you change it on a newer, inactive one. Then, by type: a blog post with no layout of its own falls back to the blog's post layout, then to the layout whose template is blogs/posts/show.html; a book or unit ignores its layout on public views; a custom entity record uses its definition's one layout; a signed-in ?revision= preview applies that revision's layout. And a site file with the same path as a platform template overrides it everywhere.