From MoodleDocs
  • This allows a user to access all groups in the given context (system, front page, course category or course context), irrespective of what group the user is in or whether they are in a group at all. For example, a user with this capability set to allow can browse forum postings of users in other groups when the forum is set to separate groups.
  • The default teacher role has this capability set to allow.
  • In new Moodle installations from Moodle 3.2 onwards, this capability is not set for the non-editing teacher role. It is set to allow in sites upgraded to Moodle 3.2.(See MDL-55981 for more information.)

Note: Users with a role in which moodle/course:managegroups is allowed and moodle/site:accessallgroups is not set are able to add/delete/update groups (and groupings, if enabled) in a course.