Night rides are better/easier to manage with a relatively small group, say from 2 to 6 people IMO (I don’t like riding on my own, find it too boring!). Anything more can be a bit of a ballache for the person leading the ride, trying to keep everyone in check.
Day rides, anything from 2 upwards. Depends more on the company than the outright numbers (quality, not quantity of course). I’ve been on awesome rides when there’s been just me and one other, i’ve been on similarly good rides in a group of 20 or more! The bigger the ride, the more of a social thing it is though, and less about the actual riding of the bikes and the terrain in my experience.
I wouldn’t say I have an outright preference as to the numbers in a group, it’s more dependent on my mood. If I’m feeling in a head down, hit the trails hard kind of mood, then just 1 or 2 other people I know well that push me and my riding abilities is ideal. If I’m in a laid back social mood, then however many you want really. Would suggest that getting much 15 to 20 people in a group, even in daylight, begins to be uncontrollable for the group leader so isn’t ideal though.