It's not that the game cannot challenge players like that. It's that if you allow all of the optional rules that make the game easier, it requires a "savvy" DM to maintain the same degree of challenge.
That sounds like a description of 3E or 4E.
In 5E I've found that this isn't telling the whole truth.
In 3E or 4E, sure, my players would have made short work of "standard" encounters, and you wanted and needed to spice things up on occasion.
But in 5E savvy players with feats and items absolutely destroy encounters. It's not just a matter of upping the challenge; it's often so bad you could throw out the encounter and completey replace it with something completely different in a whole other league of difficulty.
5E monsters are helpless in the face of a sharp party. They have substandard ability scores, skill bonuses and saving throws. They don't have elementary tricks and tools to survive the most trivial of tactics. They have nothing to counter the myriad of special abilities given to player characters.
5E gives out more goodies to PCs than ever before: just things like Bless, Bardic Inspiration and Battlemaster superiority dice give players unprecedented control over when and where monsters aren't allowed to succeed, and when and where PCs will succeed at their actions. And this doesn't even begin to talk about feats like Lucky and Great Weapon Mastery. Or even significant bonuses like Inspirational Leader or Alert, bonuses players frankly don't need because they'll succeed anyway.
At the same time, 5E simplified monsters to the point where they threw out the baby with the bathwater - most monsters are reduced to big bags of hit points with little recourse than to rush up to the heroes to try to kill them in melee. But negating this is trivial in D&D, and monsters all too often lack means of overcoming battlefield and movement control.
The overall effect is clear and distinct: 5E is by far the "easiest" edition in a long while (at least since 2000).
It is at this stage adventures are built on the expectation that play groups
does not use feats, items or multiclassing, and that they somehow keep adventuring for up to 8 encounters a day (despite humongously generous resting rules and spells such as Rope Trick and Leomund's Hut)
The end result is catastrophically easy challenges in published products.