Larian doesn't even need to change the encounters for a different number of companions. Simply divide exp evenly between all party members that participate in a fight. Maybe put a disclaimer somewhere that "BG3 is intended for and encounters were balanced assuming 4 party members. Parties of 5 or 6 will gain less experience per member and parties of 1-3 will gain more, but your difficulty may not exactly match what we have tuned the game for."
If they wanted to get a bit fancier, then they could try to find a better equation for dividing exp: e.g., divide the experience by (party size)^2 instead of just party size. They'd probably want each member of a party of 6 to get about half the exp that a party of 4 gets..? There exists some equation that effectively balances most combats for any party size.
If they wanted to get even fancier, then they could take inspiration from DAO and auto-level companions you don't take with you to [your PC's level] - 1. This would open up some shennanigans where you solo combats to get a lot of exp, which then auto levels your companions. But eh, I'm fine with that type of exploit.