Enrolment keys allow users to enrol themselves into a course, usually there is one key for the whole course defined in the course settings. However, if you define a *group* enrolment key then not only will entering that key let the user into the course, but it will also automatically make them a member of this group.