Gmod creates a gmod/cache folder, both on client, and server, any time a game is started. (Single, listen, or dedicated)
Within that folder is a 'dua' folder that lua files exist in. The file names of those files are hash.dua
(I don't know what type of hash, probably md5)
Anytime you join a server that has lua files (or other for that matter, but we're talking lua for now), the servers hash.dua file is compared to those on the client.
If a file is on the server that's not on the client, it is downloaded. Garry used hash filenames so there wouldn't be a need to worry about what version of a file the client had. If you join a server running <plugin v1>, even though you might have <plugin v2>, your Gmod will use the version 1 while you are connected to that server.
There are several key things that have to be set just right for servers AND clients for that system to work.
Server has to have created the cache properly. This is done when the server starts up (NOT just a map change)
Server has to have downloads enabled. ("sv_allowdownload") (If you have this off to prevent map downloads, that _will_ break it... enable it and set a 1mb size limit "net_maxfilesize" "1")
Client has to have downloads enabled (I don't remember all the various commands for client, but there are several, filters, etc.)
If your server isn't creating/sending the latest lua code, or your client isn't downloading it, this would still cause the issue.