There are two separate things that are going on.
One of them is encounter challenge. Risk of death/defeat and the cost of winning in terms of HPs and potentially lives. That's pretty easily adjustable by making encounters harder.
The other is the balance between at-will classes (like the rogue or the EB-only warlock) and long-rest-recovery classes like pure casters, plus there are hybrids like the paladin and the barbarian. This is the one that doesn't get addressed as much that I want to talk about.
It's not controversial to save that the average action casting one of your highest level spells does more than the average action of an at-will character. So, if all we are doing is mid to high level spell slots, the at-will characters will lose out.
It's also not a stretch to say that your average cantrip (NOT a warlock EB empowered by invocations) does less than your average at-will attack. Sure, they scale, but a rogue will have more dice of sneak attack, other classes will have extra attack and with their ability score bonus be doing more per swing, etc. So if you took all spell slots from full casters, they would be doing less than at-will classes.
So there's a ratio of spell slots and cantrips that balance out in effectiveness to what an at-will character will do. Note that it must include cantrips (or much lower level spell slots, but those often go to utility). It could be because the players don't know how many encounters are coming so they are using cantrips to save slots, but if they know the format is 2-3 enocunters per day that is less likely to happen. Which means that you need to not only get them low on slots, not only run them out of slots they are willing to cast, but have enough actions past that they they use a good amount of cantrips to balance those slots.
It gets worse because spells with durations may be more efficient in longer combats. A spiritual weapon in an 8 round combat will have more opportunities to be used than in a 3 round combat. If a barbarian normally could rage in half of the battles, having to pick and choose, is it power upgrade if to rage in every battle?
So in order to balance the at-will classes vs. the long rest classes, you actually need to have more rounds of combat, to offset the increased effectiveness of long-rest-recovery features/spells with duration. But you're doing good if you even get close, so throw in waves of enemies, bosses that have more than one form or phase, and other long, epic battles for those 2-3, designed not just for deadliness but also resource attrition.
And then there are short -rest-recovery model classes, but in a 3 encounter day you can still fit them in fairly well by ensuring they have a chance for a short rest between each encounter. That also allows the proper chance for HD spending to not overtax other healing resources.