Moodle uses a plugin model for both its authentication and enrollment services. Authentication plugins are placed in the auth
folder and are intended to control user management, authentication, and Single Sign On. Enrollment plugins are placed in the enrol
folder and are intended to manage course enrollments or role assignments. Note that there is a gray area with both authentication and enrollment plugins. Each type can perform the work of the other. For example, the LDAP (Lightweight Directory Access Protocol) authentication plugin can create system-level role assignments for the course creator role. Conversely, the third-party Banner integration, an enrollment module, can perform user creations.
Although it's possible to blur the lines, there are certain advantages of using distinct plugins for each function. Plugins allow you to mix and match sources of users versus user enrollments. This is a powerful concept and one that is not always well understood...