I mean, think about it this way; prostitution is considered by many people far more prosaic than me to be the worlds oldest profession. Let's suppose that a long, long time ago a woman in this line of work was "stiffed" by a client. She tried to collect her payment (which depending on the era may have been coins, talents of silver, polished beads, dried chunks of clay, or stream-polished stones) and was not able to.
She mentioned this to a friend, who suggested she seek help from someone who dispensed judgments, or the law-giver. This person convinced the ex-client who owed compensation to pay the woman. Once the payment was made, the law-giver took a percentage of the fee recovered as payment. And so the first plaintiff/lawyer transaction took place.
It is even interesting to note that when prostitutes needed help collecting payment, the law-givers who were going to offer this service were said to be "lawing-her" shortened to "law-her"; hence "lawyer".