I teach in a medical school. I know I have a lot of teaching in the second week of May, and students have their last teaching on 19 May and then several revision sessions the following week. I know it's different for some other, non-healthcare, courses across the university. Exams are in last week of May and first week of June. These have to be marked and all marks pulled together in time for an exam board meeting in the first week of July. We work on two 18-week semesters, but there is a 3-week vacation within each (Christmas and Easter), so it's 15 weeks of teaching/assessments in each semester.
So what do students do between midmay and September??....
It's up to them. I'd say most of them get jobs and/or travel. Some don't do very much, but of course if they're not working they don't have any money (unless parents subsidise them).
Universities aren't schools. The staff who teach undergraduates also have other things they need to do: supervision of postgraduate students, research, course development, updating of teaching & assessment materials, etc., and these take up a bigger proportion of their time when the undergraduates aren't there. Many will also have significant roles with external organisations: industry, NGOs, government departments, etc.