Scenario: There is a project your boss is wholly responsible for. You, from a technical perspective, are absolutely indispensable to the success of said project. Maybe it's a small team, or everyone is overloaded, but you can draw a direct line between you quitting (or doing a bad job) and your boss getting called out or potentially fired.
Your boss, however, is not indispensable to their boss, nor is this project indispensable to the larger department. You ask for your raise because of your leverage. Your boss might be worried and try to get it for you. Their boss, not caring about this project that much in the broader context of their work, laughs and says no.
You can absolutely be critical to the success of a project, and even important to your boss's future, but have no real leverage over your situation. That's absolutely a reason to leave but it doesn't mean you'll be able to squeeze any more money out of the place before you do.