FVWM has a complex configuration format and back in the day (maybe even now?) some people would use macro processors to generate the configuration file.
I thought the m4 files simply were the config files. This was something like redhad 3.x or 4.x? It was all m4 files to define the start menu contents and the dock and everything else.
I was new enough at the time that I guess those could have just been a front end to the actual config files without understanding that.
I just remember spending a lot of time fiddling with m4 files to get my fvwm and fvwm95 desktop just the way I wanted it.
It's nothing I chose, it's just the way it was already in the distribution.
edit... out of curiosity I've now googled "fvwm m4" and confirmed my memory. I was sort of mostly or half right. m4 is not strictly "the" config format, but it is a compile-time built-in feature that is generally always used, and old redhat in particular had a confusing setup.
Yes -- same with CPP as well. Fvwm2 allowed you to use the language features of M4/CPP to hold variables and to perform loops on different data, so you could generate complex config files that way, without needing to build that into the core config syntax itself.
However, in fvwm3, I've removed both those modules.
In 2021, I wouldn't bother.