Just to give a slightly different take on it from Mk VII’s explanation of the English position, in the common law jurisdictions of Canada (i.e. - everyplace except Quebec), lawyers are generally defined by statute to be both barristers and solicitors. The reason for that is to pick up and carry forward any common law powers relating to the two orders of lawyers, while ensuring that every lawyer has the right of audience in a court.
We do use the terms to recognise functional differences. If I meet a lawyer I don’t know and ask what sort of work she does, and she says “Barrister work” it’s quick short-hand for court. If she says “solicitor work” I know that her practice is mainly in the office.
And in major pieces of litigation, the distinction between the two functions can emerge in the way the lawyers divy up the work. For example, I’m engaged right now in a substantial court case, and there are three lawyers on our team. One deals with the client, takes instructions, reports back to the client, and so on. He’s involved in the development of our court briefs and legal strategy, gowns and comes to court, but doesn’t open his mouth. He’s the solicitor on the team.
I’ve been doing most of the actual work in court - drafting the briefs and arguing the case in a couple of levels of court. I’m the barrister.
And since we’re going still further with our case, we’ve recently expanded to include a third lawyer on the team, as junior counsel. He’s working on the legal research and strategy as well. He’ll also gown and come to court to assist, but I’ll likely do the actual gum-flapping.
If I remember correctly, the term “solicitor” came about because of the type of work they did - they solicited work. “Barristers” are so called because they had the right of audience in the superior courts, where there was literally a bar between the bench and the well of the court, where counsel stood. A “barrister” is someone who is “called to the bar”, i.e. - allowed to come forward to the bar and address the court. Senior counsel who had been appointed King’s Counsel (K.C.) or Queen’s Counsel (Q.C.) had the right to argue inside the bar, closer to the judges. Hence junior barristers were sometimes called “utter barristers” (from “outer”) while K.C.s and Q.C.s were “inner barristers”.
The English system also had other types of lawyers, like “serjeants”, “attorneys”, “proctors” and “advocates.” (You may recall Serjeant Buzzfuzz was one of the lawyers in Mr. Pickwick’s trial.) The names indicated which courts they practised in. When the courts were fused in the late 19th century, only the terms “barrister” and “solicitor” survived.