The role of the public prosecutor in the judicial system is to fight a criminal case on behalf of the government. The public prosecutor seeks to prove that the person arrested by the police for a crime actually did commit the crime.
The defence lawyer seeks to defend the person who has been accused of a crime by the police. He seeks to prove that the case built up the police is false. Even if he cannot establish the innocence of the person, he seeks to ensure that the punishment for the crime is not severe.