How did the switchboard know who to connect you to? Was there a name by each of the plugs? How did they know?
The operator had a number of pairs of plugs. When she got an incoming signal, she plugged in one of the set from the caller. At first, operators had lists of users. She usually memorized the numbers and users. The operators knew that Sadie Smith was on line 25, e.g., and also knew that Maude Jones was on line 50, etc. She had a switch that she could use to listen in, mostly to check to see if folks were still on the line, but in some cases to just snoop. There were also switches and lines to allow multiple callers on the same call.
As the number of lines grew in each exchange, it was necessary to either hire more operators, which the phone companies did early on. (When the technology changed, and dials came along, the large number of operators diminished, until there were just enough to handle operator assistance.) There were special switchboards when you needed to call outside your exchange. Early on, the local operator connected your call to another switchboard to connect to another exchange. When your call connected to another exchange, the next switchboard operator then connected you to the local exchange, and an operator connected you to your called number, and physically rang the number. When the exchanges were very small, switchboards had long enough wires to connect to multiple switchboard. (Sound complicated?)
As technology changed, party lines became automated, and not operator-run. The party line was wired to make a certain ring pattern by the length of the electrical pulse. Party lines had "coded" rings - two shorts, one long, etc. The ring patterns depended on the number of phones on the party line. Private lines were more expensive since there was a dedicated line for the customer. My grandparents had a two-party line, and their number rang one short and one long. The other party had a long and a short. That was at a time when their exchange had four-digit numbers.