The Gemara records that Avraham was called yadid – “God’s beloved” – and then continues by offering a midrashic interpretation of the passages in Sefer Yirmiyahu (11:15-16) where we find a conversation between God and the yadid.
Rabbi Yitzḥak said, At the time of the destruction of the Temple the Holy One, blessed be He, found Avraham standing in the Temple. Said He, ‘What is My beloved doing in My house?’ Avraham replied, ‘I have come concerning the fate of my children.’
Said He, ‘Your children sinned and have gone into exile.’
‘Perhaps,’ said Avraham, ‘they only sinned in error?’
He answered, ‘She has performed lewdness.’
‘Perhaps only a few sinned?’
‘With many,’ came the reply.
‘Still,’ he pleaded, ‘You should have remembered unto them the covenant of circumcision.’
And He replied, ‘The hallowed flesh is passed from you.’ (i.e. they have neglected the mitzva of circumcision)
‘Perhaps had You waited for them they would have repented,’ he pleaded.
And He replied, ‘When you do evil, then you rejoice!’
Thereupon he put his hands on his head and wept bitterly, and cried, ‘Perhaps, Heaven forfend, there is no hope for them!’
Then came forth a Heavenly Voice and said, The Lord called your name a leafy olive-tree, fair with goodly fruit: as the olive-tree produces its best only at the very end, so Israel will flourish at the end of time.
In his Ben Yehoyada, the Ben Ish Ḥai interprets Avraham’s placing his head in his hands as follows. Avraham understood that both the activities of the Jewish People – represented by the hands – as well as their thoughts and ideas – represented by the head – were equally involved in evil. He therefore placed his head in his hands and cried out in prayer so that he could appeal for forgiveness on behalf of those two elements together.