If you patched `cat` to ignore filename and just spit out each file as given, the script would still work without a single change. If you slightly changed the script to loop over the results of `ls`, it could still be compatible with scrambled filenames.
A script that didn't cheat would also be using filenames to a similar level.
In other words the filenames are a completely fair implementation detail. And that detail can be swapped out without changing the trick in any meaningful way.
The trick is based on having a series of variable-sized blobs of bytes. That's all it needs. If I use javascript instead of sh, and my decompressor is `[...s].join('5')`, I'm using the same trick.