It's a data description language for describing binary formats - this usually takes lots of error prone boilerplate to write properly, so it has a type system to help you.
Ultimately all compilers do code generation. It means that we don't have to write everything directly in assembly (or some other target language), which I think is a pretty good thing!
I would agree though that much of the code generation that we may come across in industry, which is based on strings and text replacement and error-prone, undocumented python scripts can be rather terrifying though. 😬