Q:

How does the terminal work?

Explaining more on this question.  Are commands like ls, cd, rm,... applications if they are than how does the terminal knows where they are, and is the terminal just a interface to interact with the programs, is nothing more than just programs just interacting with each other?  Secondly, Is bash the only language that will work in the terminal, if it is just programs just interacting with each other?  

A:

The terminal can be used to execute programs within a given PATH - you can find it by running echo $PATH in a bash teminal - example output:
/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/wilf/.local/bin:/home/wilf/bin:/usr/games

This is set when the terminal starts - when it using using the BASH shell (default on lots of Linux systems), it checks ~/.bashrc before starting. Then when you run a command, it searches the path for the command, and executes if it finds it.
With my example $PATH above, I can place an executable script in /home/wilf/.local/bin (e.g. extension-update from here), and then be able to run it terminal without specifying the full path to the executable (e.g. /home/wilf/.local/bin/extension-update, /usr/bin/firefox, etc)

