It doesn’t matter how many or how few, it just matters that the right people are at the right gathering.
That was really weird and awkward that your friend invited someone else on your trip. That’s an example of having the wrong people (the extra un-invited by you person) at a gathering.
On the other hand, I remember one company Xmas party we had, during the middle of the day, and although the company itself was closed to the public, we had several service technicians that came in to do some work. There was tons of extra food, because it was buffet style, so I invited them to come on in and have a bite and then I packed up extra stuff for the ones who were still working while the rest of us were eating. I ended up making several new friends that day, and no one else seemed to mind.
That just reminded me of another situation at that company. There was this horrid, bitter woman who worked there. We used to have potluck parties fairly often, either for Halloween, or for someone’s retirement party. Anyway, this woman never once actually brought anything to the potluck. She would show up after the festivities had started, barge into the buffet line, then stand over a garbage can and wolf down her food. She also never said hello or congratulations to the guest of honor. Then she’d leave as quickly as she had come. She was a hideous beast. One year, I drew her name in the Secret Santa deal. I told our receptionist, who was minding the bowl with the names, that there was no way I could choose a gift for her, other than a lump of coal. She took pity on me and let me put it back and choose another name. I never did find out who got stuck with her name.