(This is another entry in my collection of fantasy world-building ideas.)
I've picked up the habit, from people like Doctorow and Stross, of thinking of corporations and other things that are large groupings of people as a lifeform all their own. We humans, as complex multi-cellular organisms, are made from living cells, heavily-adapted from previously free-living single-celled organisms, but don't share many traits with those cells - we're a pattern on top of them, forming a totally novel form of life, with motivations and behaviors dramatically different from those of our component cells.
Similarly, corporations act like living things, built out of component humans, but acting as a novel pattern on top of those humans. Very small companies are still dominated by the individual humans in them, but at a certain size they inevitably start acting like something new, something beyond the humans leading them. You can swap out the management of most companies, and the company will continue living on mostly unchanged - they're composed of independent structure that uses humans, but is not actually driven by humans, just as we humans use cells. (The analogy isn't perfect, of course - we humans are built of trillions of cells, so any one cell has approximately zero chance of influencing us (except in rare cases like a lucky cancer cell), but corporations are made of a comparatively much smaller number of humans, so individual humans can have a larger effect on the whole.)
Biological organisms survive by expending their stores of energy to hunt down other biological organisms, consuming them and gaining more calories than they spent, to distribute to the cells that they're made up of. (Only on the extreme margins do biologicals do other things for energy, like photosynthesis or chemosynthesis. Plants and bacteria are clearly on a separate order of life than humans and other animals.)
Similarly, economic organisms like corporations survive by expending money to develop product lines and advertising, to convince other economic organisms (humans, or other corporations) to give up some of their own money, which the corporation then distributes to the humans they're made up of. They survive if they gain more money than they spent.
There's a closely related entity to the corporation that lives a dramatically different lifestyle - the state. While states do still have a nucleus of humans that drive them and which need to be fed with money (government employees), the way they feed is completely different. Rather than convincing other economic entities to give up their money via advertising and such, states simply claim space, and any economic organisms living in that space have to pay taxes to the state for the privilege of living there. States do still compete to a point, making their spaces more attractive, or their laws friendlier, but for the most part the organisms they extract money from are a captive populace.
To put the analogy a little differently, states are the brontosauruses of the economy - huge, lumbering titans that feed on whatever's around, and more or less immune to attack unless they're young or already severely injured. Corporations are the carnivores - mostly small and feisty, grabbing money where they can, but occasionally growing large and old and fearsome.
Get To The Fantasy Already
Okay, so let's shift gears to my fantasy world.
The basics of my metaphysics is that the world exists simultaneously in two layers: a physical and a narrative. Things that happen in one layer are reflected in the other; this is the basis of how magic works. At its core the world does not look like our familiar physical world, as many physical processes are driven by things in the narrative layer.
For example, atomic physics as we know it doesn't exist - the world is instead composed of a small number of complex-at-their-core elements, as I explained in the earlier Magical Metaphysics post. Our physical world is mostly composed of Physical and Biological elements, with Mental, Divine, and Energetic elements playing a more transient role. (That is, Mental elements don't "stick around" as part of physical reality; they're generated by and affect the physical world, but don't have a stable existence on their own.) The narrative layer is the opposite - it's mostly Mental and Divine, with Physical, Biological, and Energetic elements playing only a transient role.
So, spiritual beings exist mostly in the narrative layer, composed of thoughts and moral forces. They're literally made of stories, and are fed by people thinking of them (or more strongly, by worshiping and devoting themselves to the spirit). Even just reading about a spirit in detail strengthens that spirit, as your own mental impressions feed into the narrative layer and reinforce their existence.
Now to D&D. I really like the Warlock class in 5e - it's fun and unique, and I end up mixing at least a few levels into most of my character concepts. But I absolutely abhor the default flavor given to them. They're cast as mini-Clerics, devoting themselves in some way to the entity they've made a pact with and draw power from. But the default pact-capable entities are all bad! The most neutral one is an Archfey, but 5e has tried hard to make it clear that the Fey are amoral as we understand morality. The other two are just straight up demons, and eldritch horrors from beyond reality. We're supposed to believe that people who have literally contracted with demons, or promised to bring chaos and corruption into the world for magical power won't be shunned, jailed, or killed on sight? It's just straight-up evil! This is hard enough to reconcile in a standard D&D game, where everyone can just conveniently ignore most of the implications, but it's extremely troublesome for worldbuilding, where I want to have Pact Magic be the easiest and most common form of magic among people.
So, I've recast things a bit. All spiritual beings of middling power are naturally subject to Pacts, which bind them against their will and allow people to draw power from them. Pacts are a deeply-worn groove in the narrative structure of reality, and it's well-known that forging a pact with an entity requires zero agreement from that entity - there's no implication that you agree with them at all. In fact, many holy organizations heavily use demonic pacts, with the goal of draining the power of the demons and limiting their influence on the world.
But it's not totally one-sided. As I said, spiritual/narrative entities survive on attention. Being aware of them, thinking about them, recording details of them for future generations to read - all of this supports their existence. Entities who are subject to pacts are actually made more secure in existence - they're less likely to be forgotten and fade away. Pacts require careful study of an entity, to form the proper binding circle and rites, and this sort of study and recording is exactly what they want and need.
(Becoming more powerful with pact magic does require aligning yourself with the being you've bound, but that doesn't mean morally aligning yourself with them. Narrative entities have various domains, and you can align yourself with one while ignoring the more distasteful ones. For example, many demons have are spiritually aligned with fire, and so embracing fire magic or what-have-you aligns you spiritually with them, enabling you to raise your binding and increase your power.)
Note that only middling-power entities are subject to pacts. Weak entities either don't have enough "heft" to be properly grabbed by a Pact, or simply don't have enough power to survive a binding - it's in the binder's best interests to find an entity that can actually supply the power they want to draw.
Powerful spiritual entities, on the other hand, are immune to pacts as a matter of their nature. Much as the corporate life structure transitions to the surface-similar but deep-different feeding structure of the state, at some point in their growth spirits might lay claim to some area in narrative-space directly. They're no longer trying to spread and strengthen their own story, they're squatting on the abstract idea of some story, so that whenever that particular narrative plays out in the world, even if the people don't acknowledge the entity at all, it's still able to draw power from it. These are what we would traditionally call Gods, with their Domains: a God of Murder, for example, is strengthened by any murder, regardless of how or why it was performed; a God of the Harvest is strengthened by any agriculture, regardless of what it is; etc. There's still a notion of space and location in this - there can be multiple murder Gods, each feeding off of a different area.
Direct devotion to the God is still more nourishing, of course, and so they are incentivized to maintain a priesthood and spread their individual stories as well. If they become forgotten and live only off of anonymous narratives, they're vulnerable to being displaced by a fresh god, flush with worship and narrative control and looking to expand or establish their Domain. That is how Gods die - not directly by the hand of anyone physical, but by being replaced by other Gods.