Socrates

Why did Athens wait so long to put Socrates on trial? What factors– personal, political, cultural, global- influenced his trial in 399 BCE?