Learn Difference between $$ and $BASHPID in bash

Recently I was working on a shell script and I saw a significant difference in how the bash special variable $ and BASHPID behave. Every process running in Linux will be assigned with a process ID and that is how the operating system handles the process.