User can use shell inside Emacs, with shell mode, eshell or term.
in this mode, Emacs run an inferior shell, with I/O through buffer (default to *shell*).
in this mode, Emacs emulate a shell. It is writen by Emacs Lisp.
in this mode, Emacs emulate a terminal, then Emacs create a shell that you choose with the terminal.