Answer: by the state or federal government
Explanation:
The state has public defenders who get appointed by the state or court to represent those individuals who can't afford to pay for a private lawyer.
Public defenders work full time for the government.
The state always want to ensure that every person get a fair trial whether they can afford or can't afford the lawyer , this is to ensure that a person get treated with Due Process, which means they get treated fairly in a any legal matters.