The Rest of the Story about...
Altından çapanoğlu çıkmak (lit. for Çapanoğlu to pop up) -- the idiomatic meaning is for an 'activity' or 'job' to meet with an undesired or unexpected difficulty, problem, or danger.
For a time, Çapanoğlu Ahmet Pasha and his two sons, Mustafa and Süleyman, ruled like feudal lords over wide territories encompassing the city/towns of Amasya, Yozgat, Ankara, Niğde, and Kaysarı (until 1808 when Sultan Mahmut II had all three executed).
But although the Çapanoğlu's were tough rulers during their reign, they also listened carefully to the problems of their people, and, where possible, they tried to ease the lot of the underdog.
According to one account, at the time of Çapanoğlu Süleyman Bey, in Yozgat, there lived a pretty widow woman...And, a married man with a large family kept after her for sexual favours. The woman, who grew tired of the aggravating man, applied to Çapanoğlu Süleyman Bey for help.
At the Bey's command, she went one night to the married man's house and confronted him.
When she declared, "I am a woman of honor, don't bother me anymore," the man attacked her, and Çapanoğlu (who had witnessed the entire event from a nearby hiding place) had the man hanged the same night -- in the Yozgat town center!
But the episode that actually gave birth to the idiom has a rather humble old donkey to thank.
It seems that said old donkey was seen nibbling from hunger on the bell-rope in front of a grand mansion. When citizens reported to Çapanoğlu that the donkey was weak and in poor condition, he initiated a search for the donkey's owner. And when the owner was found, justice was swift and harsh.
For failing to care for the donkey, Çapanoğlu gave the owner 100 lashes of the long whip -- at a public flogging! On top of that, the man was ordered to feed the donkey five bushels of barley a day, to give it a daily washing and grooming, and to report in person once a week with the donkey for inspection by Çapanoğlu.
The old donkey (because of all this special treatment) gained quite a bit of weight in very short order, apparently. And when citizens questioned the owner about the reason behind the old donkey's vigorous new appearance, the owner (remembering well the sting of the long whip) replied, "Semirir elbet; arkasında Çapanoğlu var." (Well, of course he's gained weight; Çapanoğlu is behind it.)
And, over the years, the idiom has gradually evolved from 'arkasında Çapanoğlu var' to 'altından çapanoğlu çıkmak' -- as a sort of warning to those who think no one is watching...