See the remarks.
const MODE_SET_GROUP_ID: Mode = Mode(S_ISGID);
This flag has different meanings when applied to regular files and directories.
When the file is executed, the effective group id is set to the owning group's id.
When a file is created in this directory, the group owner of the file is the same as for this directory. When a directory is created in this directory, it additionally inherits the set-group-id flag.
stat(2) and S_ISGID therein.