How does linux specify the group to which directories and subfiles belong, and the newly created files under the directories are automatically assigned to the group

  linux, question

For example, user b, after creating a directory and using chgrp to change the membership of group a, how can the newly created sub-file or the current user group b be automatically assigned to group a

Use chown -R command