If available on the system, Cockpit uses realmd and the DBus APIs it provides to configure the system's Active Directory or IPA domain membership.
Not all systems can join all kinds of domains. This depends on the availability of the necessary client software.
For non root users, realmd controls access to its APIs via Policy Kit and a user logged into Cockpit will have the same permissions as they do from the command line.
To perform similar tasks from the command line, use the realm command:
$ realm join example.com Password for Administrator: