Hi Alex,
While that 'epersongroup2eperson' database table does manage group memberships, I would not recommend making direct changes to the database layer. It's much safer to change group memberships via our REST API.
For instance, here's the endpoint to add an EPerson to a Group:
(Additional options for working with groups can be found on that same page.) If you ever want to know how to do something in the REST API, it's also possible to just perform that task in the User Interface and watch the requests sent by the UI to the REST API in your browser's DevTools "Network" tab.
The reason I recommend using the REST API is that it will also ensure that any necessary reindexing is completed in Solr to ensure that any new permissions appear in the User Interface. If you make direct changes to the database layer, it's possible the UI will not recognize the new permissions entirely until you next reindex.
Overall, we cannot recommend direct database changes unless absolutely necessary. In any case, if you make direct database changes, you should fully test the impact of your changes, as it could result in some unexpected behavior in the UI....at least until you next reindex.
Tim