When someone recently mentioned in a conversation suddenly turns up we might say, “Speak of the Devil” as though our conversation has brought the subject into our midst.
This is precisely what the expression means, because in the Middle Ages it was believed that any mention of the Devil would be an invitation for the evil one to appear either in spirit or in action.
So other than within ecclesiastical circles, the devil’s name was avoided at all costs.
That’s why when someone we are talking about shows up, we say, “Speak of the Devil”.