I think the distribution of monsters and treasure is definitely going to vary from campaign to campaign. That said, it is not entirely clear to me that high-level (levels 17-20) PCs have to fight legendary dragons. There are are other types of high-level monsters, such as demons and devils, and the DM could also choose to use large numbers of lower-level monsters instead.The number of rolls on the table are a very bad estimate and I'd ignore it. They don't come close to matching how many monsters you will be killing, and thus hordes you will come across, based on the XP requirements to level. For instance it's quite likely you'll be killing over 60 legendary monsters from 17 to 20, many of which are dragons and should each have a horde and you only end up with 8 rolls. This is why the treasure the published adventures is handing out is higher.
In any case, regardless of the monsters he uses, a DM could choose to be as generous or stingy with treasure as he wishes. It even says so in the rules: "You can hand out as much or as little treasure as you want." (DMG, p. 133, first sentence of last paragraph, just before describing the treasure found in a "typical" campaign.)