While he was awaiting his execution, his old friend Crito came to visit him. Crito was trying to make Socrates escape from prison, so he was making arguments to make it easier.
Socrates is convinced that escaping would be wrong because he would be breaking both principles: first, Socrates would be harming the laws. Moreover had benefited him and had never harmed him (in the case of his trial, it was the jurors who were unjust, not the laws). Second, he would be breaking his agreement to abide for the laws of Athens. His conversation with Crito illustrates his conviction that philosophy requires that one act in accordance with one’s principles, not matter the cost.