Before primaries political bosses controlled state delegations at nominating conventions. When a party could not decide on a candidate after several ballots, the bosses would meet in “smoke-filled” rooms and “broker” a choice.
A little simplistic, but you get the idea.
Why does this remind me of the process through which the Pope is selected?