My impression of how this should work—though note this has never once come up in one of my own games, and I’m not rightly sure how it would unless your games involve a lot of time-skip—is that a true dragon’s dragon hit dice come purely from age, not XP at all.
Theoretically, just speaking about “dragons in the world,” most dragons probably don’t really gain substantial amounts of XP—I mean, realistically, they don’t gain any, because they’re NPCs and NPCs don’t deal in XP, that’s a player thing (cohorts and the like excepted). But imagining them as the protagonists—the PCs—of their own story, they probably don’t really bother much with XP. Dragons focus on hording wealth, establishing dominion over an area, and sometimes dealing with draconic politics. Their RHD and LA means that they need to get quite a lot of XP to actually level-up, and they’re more likely to age to their next RHD than level-up—and that just pushes their level-up back further by increasing the necessary XP. So dragons’ HD are a result of age, not adventuring. Note this is pretty similar to other creatures—most NPCs never level-up, because most NPCs are not adventurers, and that’s true for dragons as much or more as it is for humanoids. Dragons just get the “freebies” from growing older that other creatures generally lack.
Now then, what to do with Draconomicon’s rules? They specify that
As it ages, as shown on Table 3–21: Aging for Dragon PCs, the dragon is required to devote a level every few years to its dragon “class,” reflecting the extra Hit Die or level adjustment it gets from aging. The character must add thi dragon level as the first level it gains after reaching an age shown on the table. It gains no benefit from reaching a new age category until it attains this level.
(Draconomicon, pg. 142)
This is an abstraction for gameplay purposes, and should not influence the world.
That’s what’s going on here, the game designers needed a way to fit aging into the usual PC level-up structure, trying to keep dragon characters balanced with non-dragon characters. It only applies to player characters, and it only exists for balance purposes; it’s not supposed to say that this is actually how dragons in the world age. The designers just didn’t want dragon PCs getting “something for nothing” just due to time-skips.
And, finally, it must be said, that Draconomicon’s dragons-as-player-characters rules were trying to solve a very difficult problem—and they failed. The rules don’t actually accomplish balance; RHD and LA are just too burdensome for players, and almost impossible to balance out. At a given ECL, a dragon PC will be weaker than a non-dragon PC, just because class levels are better than what the dragons get. In some cases it can be close, but overall the dragon PC is harder to build well than the non-dragon one. So you have to take this whole section with a grain of salt.