Lawyers have knowledges of the laws (over 5000 pages of immigration information including laws, labor certification, investigating cases and your background to support clients' cases, etc.) so they can help clients to win the case or secure the petition to grant you an approval. Also, they can fill out the forms for you. If you have great knowledges of immigration information, you can do it yourself.
For example, if Labor petition was denied because salary was much lower than average national wage, lawyer will have to argue with labor on this and will refile with evidence like official salary average (any media source) is approved by USCIS. or If I-140 is denied, lawyer will help demonstrating how good the company is or proof that they have filed before with other immigrants in the past, etc. or If 485 is denied, they will help you to fight and win the motion case or etc.
Does it make sense to you?