So inside the
Warband/Modules/
folder, you are correct, it does read folder name to determine the module name.
However, inside the
/workshop/content/48700/
folder it seems to be stored by Steam via their workshop ids,
Inside
/workshop/
you can find a file named
appworkshop_48700.acf
where Steam keeps track of what you are subscribed to, and it's data like last updated, last time played and it's manifest name. Inside the folder
Steam/depotcache/
you can find items with filenames starting with 48700_***.manifest which is where the earlier manifest number inside appworkshop_48700 points to and tracks what files are inside their depots, with a sort of compression applied. Based on this article here
https://partner.steamgames.com/doc/store/application/builds I suspect the name of the mod is stored here inside the manifest files and steamworks integration in the engine handles reading it to determine the name. Unfortunately, the manifest doesn't seem to store the mod name in plain text, if it does indeed store the module name.
I'm not a developer who has worked with Steamworks, so this is only speculation, but I suspect this is how the workshop does it. To test it I made a duplicate of Gekokujo and named it with Light and Darkness - Specials Steam workshop id. Light and Darkness now shows Gekokujo's preview image. Interestingly, even though there is no longer a folder with the Gekokujo workshop id, it still appears on my list, just without a preview image. Trying to boot it causes a crash. So clearly the depot knows it
should be there, but it cannot find it.
Adding a non workshop mod to that folder will not allow it to show up in the modules list, and workshop mods not already listed inside the
appworkshop_48700.acf
also fail to show.