It seems arbitrary that it seems to conventionally refer to one rather than the other, but is actually even more confusing that it refers to barristers rather than solicitors when one typically seeks advice from a solicitor by consulting them for their opinion of the legal position, and not from a barrister. By the time to instruct a barrister to appear in court on one's behalf, it seems that one is largely clear on one's position already and has rather to instruct the barrister on what they wish for them to represent to the court, rather than to seek their counsel. So, what is the basis for this nomenclatural convention?
The use of the word counsel for barristers has a long history. It was used in England before the modern legal profession developed.
The sum of [a pleader or counsellor's] functions may be termed "counselling" in its widest sense, and the subject of the present study must be what the plea rolls call homo consiliarius, the counsellor. Even this compendious name can mislead. It eventually became synonymous with "barrister," in the sense of "jurisconsult," while some of the counselling came in fact to be done by attorneys and solicitors.
Help, that I hadde counseil here
Upon the trouthe of my matere.
Sense 8(b) ("A single legal adviser; a counsellor-at-law, advocate, or barrister") is first quoted in 1709, but seems also to cover sense 8(a)'s quotation of Greene's coney-catching pamphlets (1591), by distinguishing between counsel and attorney:
[He] hath his mind so full of cares to see his counsell and to plie his Atorney.
As barristers came to replace the serjeants at law, the association of counsel with barristers may have become entrenched with the appointment of Sir Francis Bacon as the first King's Counsel (1603). According to Holdsworth, A history of English law (1924), vol 6, p 472:
It soon became clear that the king's attorney and solicitor could not by themselves do all the work which their office imposed upon them. It is to this cause that we must ascribe the rise of a body of "king's learned counsel," who are the ancestors of our modern king's counsel. It would seem from D'Ewes that a body of persons so designated was known at the very beginning of Elizabeth's reign [1558 – 1603].
Counsel means a lawyer running a case in court. In jurisdictions with a solicitor-barrister split, these are most often barristers, however, the term is not exclusive to them. In a lower court case being run by a solicitor they could be called counsel, however, it’s far more likely they would be referred to by name.
American usage is the same - a lawyer in court is a counsel or councillor.