Two Debian systems with different history of apt-based and local software installations. On one system, cmake-mode works, on the other not, though file /usr/local/share/emacs/site-lisp/cmake-mode.el is present on both systems.
On one system, variable auto-mode-alist contains rules for CMake, on the other system not. Via C-h v auto-mode-alist we are told that "auto-mode-alist is a variable defined in ‘files.el’", with the link pointing to /usr/share/emacs/27.1/lisp/files.el.gz. So the difference comes from that file? No, that file is identical on both systems, and does not contain any rule for CMake.
Questions thus: By what mechanism are additional rules written to variable auto-mode-alist? What could have gone wrong on the system that does not support cmake-mode?