Assuming there is at least one group of 5, then there will be 3 groups of 6 (and 6 groups of 5).
Here’s how to solve this, if we put F=number of groups of five people, and S=number of groups of six people.
5F+6S=48, 5F=48-6S, F=(48-6S)/5, and F and S have to be whole numbers. We can write F=6(8-S)/5 so 5 must go into 8-S. If S=3, 8-S=5, which is divisible by 5, so F=6. Therefore there would be 3 groups of 6 and 6 groups of 5, making 48 people. Also, if S=8, F=0, so there would be no groups of 5 people, and there would be 8 groups of 6 people. But if we rule out F=0, there must be 3 groups of 6 (the rest forming 6 groups of 5).