This quote suggests that taking on the role of your own lawyer, rather than hiring a professional, is unwise and can lead to unfavorable outcomes.
As with many proverbs, it is difficult to determine a precise origin but this expression first began appearing in print in the early 19th century. An early example comes in The flowers of wit, or a choice collection of bon mots, by Henry Kett, 1814: observed the eminent lawyer, “I hesitate not to pronounce, that every man who is his own lawyer, has a fool for a client.