Focus fire is not the only relevant tactic
You've correctly identified that focusing damage on one PC to get them out of the fight is a better tactical move for a group of enemies than spreading the same damage across the party. This is a natural consequence of the fact that the rules of the game don't give any penalty for having low HP - a PC (or enemy) at 10 HP fights just as well as one with 50 HP. Therefore, it makes sense to reduce PCs to 0 HP one by one rather than working on every PC's HP simultaneously.
While this is a strong tactical consideration, it definitely not the only one - and balancing it with other tactical considerations (including constructing encounters so those considerations can be relevant) will make your combat richer.
For the rest of this answer, I'll list some tactical considerations that might sometimes be more important (either individually, or in combination) to enemies than just following the focus fire strategy.
Starting Position
Where are your enemies starting? Sometimes they will all start together (e.g. if they are huddled round a campfire), but often they will be separated. Even in an ambush situation, where enemies have the choice of where to start, it will often make sense to attack from multiple sides, to cut off lines of retreat. Starting from different positions will change which PCs the melee enemies can reach, and sometimes affect the lines of fire available to ranged enemies.
Opportunity Attacks (melee)
For whatever reason (starting position, the PCs going first, etc.), one of your melee enemies is in close combat with a PC that isn't the one a couple other enemies are focusing. What should they do?
If they move away from the PC they're engaged with, they will allow that PC an opportunity attack against them. At low levels, this is almost equivalent to giving that PC an extra turn of damage. At higher levels, Rogue or Paladin PCs can deal massive damage on opportunity attacks, and PCs with the Sentinel feat can entirely negate the attempt to move.
Giving the PCs this extra damage might or might not be worth it on a strategic level, but meanwhile the enemy will (usually) also have some desire for self-preservation, and so will value their HP more than that of their fellows.
Cover (ranged)
Opportunity attacks are all well and good, but only really a problem for melee enemies. Ranged enemies can freely focus PCs, right? Well, only if they have a clear shot.
Half cover provides +2 to AC, three-quarters cover provides +5, and creatures in full cover can't be targeted at all. All other things being equal, it makes more sense to fire at PCs with lower AC, and cover changes those numbers. It's also worth noting that creatures in the path of a ranged attack provide half cover.
For PCs that deal damage at range (including wizards), it makes a lot of sense for them to duck out of full cover, fire off attacks or spells, and duck back in, if they are able. And if such a strategy is available to them, it will make it much more difficult for ranged enemies to focus them.
AoE damage abilities
You say enemies in your world fear wizards? As well they should, if they only ever all rush over to the wizard, bunch up around them, and attack. If I were your PC wizard, I would look at all your melee enemies clustered around me, and gleefully Fireball myself (either downing myself in the process, or casting Absorb Elements to halve the damage if it would save me).
More generally, if all your enemies are in one place, focusing on one character, it makes it that much easier for the PCs to use what powerful, indiscriminate AoE spells they may have to great effect. If instead your enemies are woven through the battlefield and your PCs, such AoE spells will usually be more trouble than they are worth as they would hit multiple PCs, while not hitting all or even most of your enemies.
Why won't you die?!
Some PCs are designed defensively to absorb fire for their friends. Focus fire makes sense a lot of the time, but it rarely makes sense to focus the Barbarian who is halving all the damage they receive, or the 20+ AC Fighter. If these are the only targets all enemies can reach, it probably makes more sense to spread damage rather than focusing them, as their ability to mitigate damage is much higher than that of their friends.
Enemies able to inflict conditions
Focus fire is powerful because the effectiveness of PCs doesn't decrease with HP. However, if your enemies can inflict a debilitating condition (blinded, restrained, poisoned, etc.) on the PCs, their effectiveness will decrease while they still have HP remaining. If your enemies have a capability of this kind, it will often make sense for them to target different PCs - after all, a PC doesn't suffer any more from receiving the blinded condition if they were already blind, but a second PC being blinded will be very bad for that PC.
Countering focus fire
Focus fire is pretty powerful, right? Often, it might be worth investing battlefield resources into preventing the PCs from utilizing that tactic. Consider two options, given 6 enemies and 4 PCs:
- All 6 enemies focus on 1 PC. The other PCs then come over and focus on one of the enemies. Both sides focus a single target on the other side one by one until one side wins.
- 3 enemies focus on 1 PC, while the other 3 each move to a different other PC to keep them occupied. Once the first PC being targeted goes down, the 3 enemies focusing them move on to the next PC.
In scenario 1, the PC being targeted will go down quick, and whichever side has more firepower will end up winning.
In scenario 2, the PC being targeted will go down slower than in scenario 1 - but they are still being focused down relatively fast, and the PCs are not receiving the benefits of utilizing the focus fire tactic themselves. In this scenario, the enemies are leveraging their greater numbers, potentially allowing them to make up any deficit in firepower compared to the PCs.
How might a single enemy keep a PC occupied like this? Well it could be as simple as threatening an opportunity attack if they move away. Or of grappling them so they can't move and have to use an action if they want to escape. Or of knocking them prone to make them vulnerable and reduce their movement.