In D&D, when you want to evoke a mythic treasure hoard, you speak of dragon treasure. Apart from royal treasuries, those are probably the world’s biggest accumulations of wealth.
In the real world, for the same effect, you speak of pirate treasure.
Awesome D&D pirates should probably have as much treasure as dragons, right? Considering that most D&D campaigns are basically Beowulf on land and the Spanish Main at sea? In fact, OD&D and AD&D did have special, rich treasure types for pirates, along with treasure map rules. Awesome! (Was 3e the first edition to drop the ball? Were pirates even mentioned in the core 3e books?)
How do pirates get so rich? They attack rich merchant ships and steal their stuff all day. That’ll do the trick.
I think we have to think of dragons as land pirates. They spend a lot of time looking for humanoid merchants, and then they steal their stuff. This sort of changes default dragon behavior. Dragons aren’t untamed isolationists in the wilds: they’re robber barons in the borderlands. They’re deeply concerned with the human economy: they track trade routes and estimate the riches of towns. They probably all employ spies. They don’t relish a hard fight anymore than pirates do. They probably avoid bands of adventurers in the wilderness, just as pirates avoid military vessels, unless the adventurers are guarding a caravan.
With their long lifespans, the older evil dragons might think of themselves as stewards or gardeners of civilization. They don’t want civilization wiped out. They want it to prosper and circulate wealth, just shy of the point where it’s strong enough to fight off dragons. In fact, dragons are probably a force that keeps D&D stagnant at its late medieval tech level. Are you developing anti-aircraft, or a tenth-level spell? Expect a dragon attack. Are you planning to ride with your hordes through the civilized lands, making mountains of skulls and ushering in a dark age? Expect a dragon attack, this time in defense of civilization.
One more question: How the heck do dragons accumulate piles of coins? For a dragon with huge claws, a coin on the ground is just as inaccessible as if it had been dropped from a pirate ship into the ocean. Dragons do have opposable claws, though, so they can presumably pick up sacks, treasure chests, and even wagons, and carry them off to their lairs.
Hey, I have an idea for surviving a dragon raid with your life: Hold up a bag of gold and say this: “Our caravan has 10 bags of coins. Let us live and you can have all ten. Or attack us, in which case I’ll dump these coins on the ground. You can slaughter us all and still get 9 bags of treasure, but good luck picking up these 500 loose gold coins from the underbrush.”