In the Crito, Socrates is in prison awaiting execution for impiety and corrupting the youth. His impiety was judged to be a matter of questioning and possibly disbelieving the traditional gods, and his corrupting the youth was a matter of his teaching them to do the same.
Crito arrives at the prison having arranged an escape opportunity for Socrates, and they proceed to debate whether it would be just for Socrates to escape.
Socrates argues that while the verdict was wrong, it was nonetheless reached through legitimate procedures — the trial was conducted according to the established rules, he had a chance to make his case, and the voting was done by citizens.
Read more at Stephen Hicks