What did socrates do to get executed?

because of his iconoclastic attitude that not everyone liked