The actual name that you define does not matter as long as it unique. Using a capitalised version of the filename preceded with an underscore makes this more likely but it can actually be anything
They are just arbitrary unique names. There is no magic to this. The use of the filename converted to UPPERCASE_WITH_UNDERSCORES is a common approach, and gives some hope of uniqueness.
As for the leading underscore, probably that's just a quirk of a few developers. This is actually not a good thing to do because all identifiers that begin with an underscore followed by an uppercase letter are reserved in C++ and use of these identifiers results in undefined behavior.