-
A process belongs to a process group. So it has a process id and a process group id.
-
Generally the process group id is inherited from its parent, but the process group can be changed.
-
When a shell creates a process to execute a command, it would ordinarily have the process group id being the same as that of the shell. But the child can change its process group id. The that child and any of its children will have process group id the same as the child, not the shell.