Executables are executed by the kernel. They have the x bit set and a header that the kernel reads to decide what to do with them.
But my main point was that extensions aren't really a thing used at OS level to determine file type like on Windows, like the OP said.
A regular POSIX shell will simply call the `exec` syscall on the path provided. It may set up some environment variables or parse some arguments, but it will not actually read the file. In fact you can have a file with executable permissions, but not read permissions.
The kernel determines how to execute the file based on its Magic Numbers, which are the first few bytes in certain file formats that will specify what type of file it is. It just so happens that the one for scripts are `#!`.
Some apps do care about extensions but this is not really an OS thing. And some files have to have specific names but that's really a thing in any OS.