Replace amenity=townhall
with whatever feature type you are trying to find inside a particular area. Here’s amenity=ranger_station
in Monongahela National Forest. The features don’t need to be part of the boundary relation object to be findable, just geographically within it.
It’s really not that innovative, just a shortcut to avoid having to do a spatial query. Imagine using the same shortcut for a town’s court house, police station, fire station, library, school, hospital, and more. Pretty soon boundary relations would be huge pain to work with and nobody would want to touch them.