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 invoke a shell that you choose, then link to the terminal.