What happens when you type ls *.c
When you write ls *.c in your shell a process is triggered to assure the better answer.
After you hit the enter key the shell has to decide what kind of command has been entered. There are two categories that are possible: Internal command and External command. In general, we can see that internal commands are built into the shell and externals which are not built into the shell (see more: https://www.geeksforgeeks.org/internal-and-external-commands-in-linux/).
Once the shell finds out what category of command has the user entered they proceed to execute immediately, for internal ones, or to find it for externals ones.
But, how can the shell find the external command? The answer is as simple as powerful: using the environment, more accuracy the PATH global variable. But, PATH global variable? Yes, this variable contains the different directories where the shell can find the entered command. Therefore, the shell iterates the directories that PATH variable contains from the left to the right and for each try to find the command.
Once that happens the command is executed and its results reported to the user.