A useful help would be also the theme
schema
which describes all declarations and their connections.
On top there is 'stylemenu' with its a default language and
selected style ('defaultvalue').
It can contain many layers.
A 'layer' can have another layer as parent, inheriting its
elements.
The 'visible' declares its appearance in the UI (which is
implemented by the user).
The 'enabled' declares if the layer is selected and its categories
are rendered on map, like
checked
in example.
A 'layer' can have also many categories ('cat') and many
'overlay'.
The difference between them is that a 'cat' is relevant directly
to a 'cat' declared in subsequent theme rules.
An 'overlay' is used in 'visible' UI layers to host another
previously declared 'layer'. In that case the enabled state is
determined by that layer, not the host and can be shown in UI.
I understand that the whole concept seems a bit complex, but it
evolved after many iterations in Mapsforge to become the powerful
tool being today.
Best advice is to practice with simple menu like in VTM and study
advanced ones like in Mapsforge.
In VTM example the first two layers with ids "sea" and "land",
describe only the sea and land and are not visible to possible UI.
Layers with ids "1" and "2" are the visible layers and can contain
many other 'cat' and 'overlay'.