It finds them from law graduates who are looking for a job. The state is just as legitimate an employer as everyone else. You can't just go straight from law school to owning your own multi-million dollar law firm; you usually have to start out working for someone else, and that can include the state.
State salaries are not necessarily that much lower (if indeed lower at all) than private employers. Additionally, the public system often has better employment conditions than the private one, and state employees often have better rights and protections than those under private employers.

