Let's take two scenarios. In both scenarios, the party is wandering over a wilderness country more than 40 miles from a friendly town, where goblins are known to dwell.
In the first scenario, the party comes across a group of a dozen goblins busily quarrying into a rock surface just above the tree line. The work on the rock is recent, as the goblins have succeeded only in cutting down about seven to eight feet, all of it in the shape of an open pit that's nothing at all like a shaft. Perhaps a few weeks work altogether. The goblins all have picks and there's about 500 g.p. worth of complex construction equipment laying about, just as we would expect with a site. They're just goblins, so the party decides to fall on this little group and kill them, seize the tools and delicate instruments and head back to town.,
In the second scenario, the party is walking along the edge of the same treeline, where everything seems serene and peaceful. There are no diggings, no sign of any goblins at all - but all at once, the party is hit by a squad of a dozen well-armed goblins who rise up from the rocks above the tree line. These all fire arrows into the party, hoping to catch the party by surprise. If the party turns and flees, the goblins are ready with spears; and if the party turns towards the goblins, to try to make their way up to the rocks, the goblins are scattered and well able to get two or three more arrows each before the party can reach even one of them. Either the party has to separate and go after the goblins individually, try to hit them with missile weapons though the goblins are well under cover or simply give up the field and hope to take the goblins in the trees. These goblins are well set up to get the party in trouble.
Now ask this question. Which of these two groups of goblins are likely to have more hit points?
Is it completely random? Really? Are we saying that the second group just grabbed a dozen goblins from the nearby lair without picking the best goblins for the job? Because that seems pretty dumb. If your high school has a basketball team, is the team picked by just going randomly around the school and grabbing people without thinking about it? Or is the selection process a bit more elaborate?
And what about these fellows in the quarry. Sure, they're tough and strong and they've got picks - but does that really make them ready for a military standoff? Do you think they been chosen to work this dig because they swing a mean pick? Or might it be, since the work is just starting and there's a greater need to have engineers and goblin geologists who know what they're doing in preparing the intricate arrangements needed to start a mine. Might it not be that these goblins were selected for their brains and not their combat prowess, hm?
It is true that D&D is a game and that games are based on random dice. However, D&D is not just a game. It's also design, the process of deciding what the numbers stand for, what dice to throw and why this roll counts and that doesn't. It isn't just playing craps, it's inventing craps - and it's a helluva lot more complicated than craps.
It means that long, long before the players arrive at the table to throw their dice, the table has to be built and it has to make sense. When the players see the collection of diggers, they're entitled to make an intelligent guess at how capable these goblins will be where it comes to defending themselves. This enables the players to make the same kind of evaluation of the game that a craps player makes when deciding whether or not to double down on making a point. A 10 is very different from a 6 in this regard.
It isn't unfair to change the 'rules' about how many hit points the goblins have given each special situation. Taking the goblins at the quarry includes all the elements of rolling a 6. Handling the goblins at the ambush, that's rolling a 10. And if there are goblins in the trees, too, waiting for the party to run into them . . . well, that's craps, baby.
If you want a better world, don't let the structure of the game become such a straight-jacket that it forces elements of space and time into the same mundane lithium-fed snore-fest. Let the monsters be tougher if the situation calls for it; and balance that by making the monsters weaker when the situation calls for that. Sure, the dice are the game - but you're the DM and you've got to be the game, too. You're the one setting the odds.