if we add the numbers from the ratio (5+7=12), we can divide the students into 12 groups, 48/12=4, the groups will have 4 people each.
that means that every number in the ratio actually represents this many groups of 4, so the first one is 5 groups of 4, that is 20 students and the second is 7 groups of 4, that is 28 students.
so there are 28 girls and 20 boys, which is 8 more girls than boys!