Where does NC store the tags which a user adds to a file? Are such tags available only within NC, or are such tags visible and editable on a synchronized file system outside of NC, e.g. in the Finder of macOS?
From a database perspective, Nextcloud stores all tags in the table
oc_systemtag, and all the file-tag relations in the table
In the database.
Exactly, but each app seems to handle them differently from Files. So, it is not well integrated afaik.
are such tags visible and editable on a synchronized file system outside of NC, e.g. in the Finder of macOS?
Nope. Support tags on all clients would at least make the database tags accessible from the desktop apps.
See many tag related requests on the github repo. Agreed that making better use of them would be awesome, whether in the database or the filesystem. Also, see this discussion on expanding projects functionality.
You’ll want to read tag usage through ~all apps for a solid idea of the discussion that has gone on for some years.