The parentheses create a subshell, with all the implications that it has for the current shell.
- The subshell cannot change the environment of the parent shell; sometimes, you want a subshell so that you can, say, quickly
cd to a different directory without affecting the working directory for the rest of the script
- The subshell has a single standard input and a single standard output stream; this is frequently a reason to start a subshell
- The parent shell waits while the subshell completes the commands (unless you run it in the background)
If it helps,, think of ( foo; bar ) as a quick way to say sh -c 'foo; bar'.
A related piece of syntax is the brace, which runs a compound command in the current shell, not a subshell.
test -f file.rc || { echo "$0: file.rc not found -- aborting" >&2; exit 127; }
The exit in particular causes the current shell to exit with a failure exit code, while a subshell which exits does not directly affect the rest of the parent shell script.
(Weirdly, POSIX requires a statement terminator before the closing brace, but not before the closing parenthesis.)