... one could be a "lawyer" by studying law books and calling himself a "lawyer."
But "esquire" was a title given to a member of the International Bar Association, which was controlled by the King of England.
Then, like today, a lawyer can only represent someone in court if he is a member of the Bar. Today, that might not (?) be associated with England, but it was back then.
Besides that, an "attorney" (esquire, not necessarily "lawyer") is an officer of the court, which means their allegiance is to the court, not to you.
Whatever the situation was back then, today an "attorney" is a member of a privileged society which claims to have a monopoly on the business of law, which in itself is objectionable to many.
As mentioned below, "JD" is a title similar to "MD" denoting educational status at the doctorate level, not membership within a legal society which claims a monopoly on a particular industry. "Esquire," at least back then, was a title given to members of this society (controlled by a foreign power, at least back then).
Want DP delivered to your inbox daily? Subscribe here: