How do I write folder-agnostic shell script on Mac as I can do in Windows?
There are two concepts relevant to understand what's going on here:


when running binaries or shell scripts as name-of-executable, the shell looks into $PATH for the list of directories the binary/shell script could be stored it. The first match found is then used to run the binary/script, if no match is found you get an error message. If instead you run it as ./name-of-executable or /path/to/executable $PATH is not searched but the path is taken either relative to the current directory (if it starts with ./ or ../) or absolute
each process (including each shell script) has a default directory it runs in and which gets inherited to any child processes started


So in your case if you run ./a.sh the current directory remains the one a.sh is stored in even when subfolder/b.sh is running, which then lets ./c.sh fail.

The easy way out of this to always change directories before calling child processes (and of course changing back afterwards). So in a.sh you would write

cd subfolder
./b.sh
cd ..


which would allow b.sh to call ./c.sh within the same subfolder without problems.