Ime the most reasonable case is an optional compilation of native components when prebuilt ones are not compatible. See also node-gyp
Some tools also install pre-commit hooks. I don't like this practice, but I get why people are using it.
Compiling native extensions that link against libraries that can’t be included in the package for license reasons. That’s probably the one reason that simply can’t be removed.