https://en.wikipedia.org/wiki/Robber_baron
The Rhine river hills are covered with the castles of robber barons who took protection money from ships. I had ancestors who lived in Central Europe who lived near enough to a robber baron. From time to time, the baron's men would ride out from their castle and steal everything they could carry from neighboring villages.
> The Rhine river hills are covered with the castles of robber barons who took protection money from ships.
How exactly does this differ from "taxing"?
(Actually, shipping tolls on the Rhine were supposed to be set according to guidelines set by the Holy Roman Emperor; the robber barons violated these guidelines)
The wikipedia article suggests that the robber barons weren't difficult to stamp out, because they lived openly in giant castles. They existed because there wasn't a government above them to squash them. Filling a power vacuum doesn't make you a bandit, it makes you a warlord.
Political systems that don't have proper checks and balances always devolve to caste banditry - which is not quite the same thing as getting something useful for your money.
Hammurabi certainly didn't devote his funds to public health care or public education. Infrastructure, yes. R&D... probably not. Monuments, public religion, and the military would have figured in his budget.
What you get back from taxes is stability. If robber barons kept ships from being attacked (other than by themselves) along their stretch of the river, they were fulfilling the necessary function of a taxing agent.