When all rests are short rests, except two per level become long rests, the math works out the same. With regard to spells: short rest is that, long rest is that. Such as Warlock versus Wizard.
The difference is, the DM can create any number of narratives they want. A level might happen in a single day with door-to-door dungeon combat encounters. Or stretch out across months while sailing on a ship with occasional encounters. Or be in a social campaign with many social encounter challenges. If the effort to overcome the challenge feels worth an encounter, it counts as an encounter.
Roughly, there are about 9 encounters per level, but it depends on which level, and tier 5-8 is more like 15 encounters per level.
Where the math (hilariously) assumes about 7 encounters per day (6-8), the math anticipates about two long rests per about every 14 encounters.
Whence two long rests per level works well.
These long rests can happen at ANY time during the level.