Both.
Some apps use the global setting, some have their own. Pages has it’s own settngs, as do many of the other word processors. Note taking apps usually abide by the global settings. Text editors can go either way.
In general, if the app does not have it’s own setting for spell check, then it will usually use the global one, or have no spell check at all.