The informal concept of "free software" predates the formal movement by RMS. Early "applications" software was published in printed form without any expectation that it was covered by any license or copyrights. It was the fruits of, and part of an iterative process of the research.
Quite a bit of early software created by end-users was printed in the nascent community newsletters in an era that pre-dated e-mail, faxes, and far, far pre-dated "the web." Other bits of it were "published" over UUCP/Netnews (both of which were early examples of free software).
Shareware emerged primarily from PCs (IBM compatible microcomputers) and Macs. These were machines which made binary distribution of software feasible. This meant large numbers of "sites" or "units" with relatively uniform OS (run-time environments). Shareware made more sense in a world where you had this large potential customer base, and where those end user machines usually didn't include a compiler and tool chain. (Not only was the source code unnecessary for that deployment, it was useless to most of its potential user base).
Anyway, shareware was largely a digression from truly free software. GPL and BSD are evolutions from public domain publications (source listings).