I had been thinking that in response to the original prompt, because it's an interesting difference, right? Modern religions often focus on orthodoxy, believing the right things; but ancient polytheisms didn't care about that. They cared about orthopraxy, which is doing the right things.
Ancient polytheistic religions were fairly functional and transactional. They didn't spend much if any time thinking about "belief"; at least in the Mediterranean, atheism basically didn't exist, and the closest you got was believing the gods didn't care about you. (Bret Devereaux writes about this, and other differences between D&D religion and real historical polytheisms, here.)
Cultures do ritual sacrifice because "it works". (Yes, it doesn't "work" in reality, but it "works" in the sense that the cultures are performing these sacrifices and surviving, therefore the sacrifices are at least compatible with surviving as a culture.) And that comes before the theory, honestly; but the purpose of ritual is to make things happen. They're tools. And "just as a hammer and a wrench do not very much care if you think the ‘right things’ about hammers and wrenches, so the ritual does not care if you ‘believe’ in it, or have the ‘correct’ doctrine of it, so long as – like the wrench and the hammer – you use the tool properly."
And then the sacrifice is an exchange.
Do ut des is Latin and it means, “I give, so that you might give.” ... The key here is the concept of exchange. The core of religious practice is thus a sort of bargain, where the human offers or promises something and (hopefully) the god responds in kind, in order to effect a specific outcome on the world.
So then we can ask, what was the theory for why this stuff worked? And that varied.
Now, why do the gods want these things? That differs, religion to religion. In some polytheistic systems, it is made clear that the gods require sacrifice and might be diminished, or even perish, without it. That seems to have been true of Aztec religion, particularly sacrifices to Quetzalcoatl; it is also suggested for Mesopotamian religion in the Atrahasis where the gods become hungry and diminished when they wipe out most of humans and thus most of the sacrifices taking place. Unlike Mesopotamian gods, who can be killed, Greek and Roman gods are truly immortal – no more capable of dying than I am able to spontaneously become a potted plant – but the implication instead is that they enjoy sacrifices, possibly the taste or even simply the honor it brings them (e.g. Homeric Hymn to Demeter 310-315).
Now you can see how e.g. the Aztec take relates to the "gods need belief" thing, but it's also very different, because the Aztec gods needed sacrifices. They don't care about the belief, they care about the stuff and the actions.
So the "gods need belief" thing is sort of a weird fusion of ancient polytheisms, which posited gods who needed or wanted sacrifice, with modern religions, with their focus on belief and orthodoxy. So it can basically only happen in a modern-invented pagan or polytheistic religion—which is, presumably, why we see them popping up in mid-century sword and sorcery stuff. It's a vague recreation of the shape of ancient polytheisms, but filtered through a very modern take on what religion is and how it works.