A daemon was a spirit that was intermediate between mortals and gods, and that served as messengers for the gods. Socrates claimed to have a daemon that gave him warnings. Xenophon believed that that claim was the basis for the charge that Socrates introduced "strange gods" into Athens:
The indictment against him was to this effect: Socrates is guilty of rejecting the gods acknowledged by the state and of bringing in strange deities: he is also guilty of corrupting the youth.
First then, that he rejected the gods acknowledged by the state — what evidence did they produce of that? He offered sacrifices constantly, and made no secret of it, now in his home, now at the altars of the state temples, and he made use of divination with as little secrecy. Indeed it had become notorious that Socrates claimed to be guided by ‘the deity:’ it was out of this claim, I think, that the charge of bringing in strange deities arose. He was no more bringing in anything strange than are other believers in divination, who rely on augury, oracles, coincidences and sacrifices. For these men's belief is not that the birds or the folk met by accident know what profits the inquirer, but that they are the instruments by which the gods make this known; and that was Socrates' belief too. Only, whereas most men say that the birds or the folk they meet dissuade or encourage them, Socrates said what he meant: for he said that the deity gave him a sign.
(Memorabilia, Xenophon, Book I, Chapter 1)
In fact, Socrates' prosecution was probably politically motivated. After Athens lost the Peloponnesian War, Sparta installed an oligarchical satellite government in Athens. The Thirty's brief rule was tyrannical and bloody. Its leader, Critias, had been a disciple of Socrates. Likewise, Alcibiades had been an associate of Socrates', and Alcibiades--aside from being generally notorious--defected to Sparta during the war. Socrates himself was an oligarchic, antidemocratic lover of Sparta, and he was blamed for how Alcibiades and Critias turned out. One of Socrates' accusers, Anytus, had been a leader of the democratic forces that overthrew the Thirty.
However, after the democracy was restored, a general amnesty was reached that prohibited anyone from prosecuting someone for their past actions related to the war. The charges against Socrates were likely a way to get around the amnesty. In fact, impiety trials were often politically motivated. For more, see "Athenian Impiety Trials: A Reappraisal", by Jakub Filonik.