Nextcloud Teams allows people to create their own groups of people/colleagues/friends. Those groups can then be used by any other app for sharing purposes.
The app was formerly named circles which is still used as internal identifier a lot.
The Teams app is installed and enabled by default.
You can use the \Psr\Container\ContainerInterface, see dependency injection, to get the \OCA\Circles\CirclesManager class, see our API documentation for its interface.