The which command tells you the location of an installed command line program. For example, which sh asks for the location of the sh (shell) program. On most machines it lives at /bin/sh in Learn Linux

If you were to cat /bin/sh, you wouldn’t see readable text. You’d see a screen full of garbage. That’s because your sh program is a compiled executable, probably written in C. The raw machine code isn’t meant for human eyes.

A file with a .sh extension, on the other hand, is a shell script. It’s a text file that contains commands that will be interpreted and run by the sh program. They are both executable programs, but only one can be run without the help of another program.