In the Wikipedia article for time sharing, it says
The "state" of each user and their programs would have to be kept in the machine, and then switched between quickly. This would take up computer cycles, and on the slow machines of the era this was a concern. However, as computers rapidly improved in speed, and especially in size of core memory in which users' states were retained, the overhead of time-sharing continually decreased, relatively speaking.
The fact that overhead decreased with increased core memory seems to imply there was a sort of swap file that needed to be used if memory was limited, temporarily moving data from memory to long term storage like tape and then back again. Is this how it worked? If not, how did these systems distribute memory among their users?