Ok, now I understand. Many thanks for your qualified help!
It _used to_ be the case that it was an environment variable set (and
exported) by ./debian/rules, but then people realized that under this
configuration, debhelper would behave differently when run by the
makefile than it would when run manually (for testing, debugging,
etc.). So debhelper was modified to look at ./debian/compat (with
DH_COMPAT as an override).
I guess you can still use export DH_COMPAT=4, which makes ./debian/
cleaner IMHO, but you have to remember to set that variable when
manually running dh_* commands..