Lets say you are creating groups or adding users to groups, what is the API call actually doing in the back-end? Is it utilizing the REST API? or is it directly interacting with the DB?
At its core, the ArcGIS API for Python is a Python wrapper to the ArcGIS REST API. That said, the ArcGIS API for Python has expanded its functionality over time to work with local geometry libraries, currently either ArcPy or Shapely.
You can run Fiddler or a similar program to see the REST calls being made to AGOL or ArcGIS Enterprise.
Retrieving data ...