The term "mainframe" comes from telephone switching technology -- the electromechanical kind from before the time of electronic telephone switches. Its association with computers is from the earliest days of the commercial computer business and precedes the minicomputer era by quite a bit.
As I understand it, in an electromechanical telephone switch, the "main frame" (note the space) was the rack where the central control and switching components for the switch were located. In a computer system, it usually applies to the cabinet where the CPU and memory reside, perhaps including the I/O controllers, as opposed to the peripheral components. The term "mainframe" is still used today for enterprise-class systems (to the horror of their marketing and advertising minions), even though the mainframe components may be wholly contained a 1U module for a 19-inch rack.