bash, sh, and zsh are all shells — the programs that read your commands and hand them to the kernel (see Terminal vs Shell vs Kernel). sh is the original, minimal POSIX shell. bash (Bourne Again SHell) extends it with arrays, better scripting, and is the default on most Linux systems. zsh adds extras on top of bash-like syntax — spell correction, better completion, themes — and is the default on macOS.
Your scripts’ shebang depends on it: #!/bin/bash and #!/bin/sh behave differently.
Your startup file depends on it: ~/.bashrc for bash, ~/.zshrc for zsh, ~/.profile for login shells.
“It worked on my machine” bugs are frequently shell bugs — one shell’s feature is another’s error.
Learn which shell you are in (echo $SHELL, echo $0, echo $BASH_VERSION) and the three names stop being confusing. They are one family tree, and you now know the branches.
echo $SHELL # your default (login) shell
echo $0 # the shell running this session
echo $BASH_VERSION # non-empty only in bash
echo $ZSH_VERSION # non-empty only in zsh
ps -p $$ # the process name of the current shell
#!/bin/sh # POSIX-only features: runs in sh, bash, zsh
#!/bin/bash # bash-only features: arrays, [[ ]], local
# Portable test — works in every shell:
if [ "$a" = "$b" ]; then ... fi
# bash/zsh extension — do not use in #!/bin/sh scripts:
if [[ "$a" == "$b" ]]; then ... fi