$!
is the PID of the job that this shell last placed into the background. If you want to do anything with it, you should usually save it to a variable, since running another background process will overwrite it. $!
is like $?
in this respect, although it doesn't get overwritten nearly as quickly.
Like with any other variable, if you want to make it available to a child process, export it to the environment.
background_command &
export background_command_pid=$!
…
bash -c 'echo "My background sibling process is $background_command_pid"'
By the way, contrary to your assertion, $!
is preserved in subshells.
$ sleep 3 & echo $!
23791
$ { echo $! | cat; }
23791
$ ( echo $!; /bin/cat /dev/null; ); /bin/cat /dev/null
23791
$ echo $! $(echo $!)
23791 23791
Running another instance of bash is not a subshell. You're confusing a subshell with a child process that is a shell.