JERUSALEM — It was a potentially devastating blow to Benny Gantz, the former army chief battling mightily to depose Prime Minister Benjamin Netanyahu.

On Thursday, four days before the election — their third contest in under a year — a recording of Mr. Gantz’s top strategist privately denigrating Mr. Gantz’s courage and capacity to defend the state of Israel was broadcast on the evening news.

[Update: Israel’s election: 6 takeaways.]

Where the recording came from was a mystery when it was broadcast on Israel’s Channel 12. Only on Friday, hours after Mr. Gantz had fired the strategist, Israel Bachar, did answers emerge — giving Israel’s long-running political drama its most bizarre plot twist yet.

A few weeks ago, it turned out, Mr. Bachar had gone to see a rabbi about a personal problem. He and the rabbi, Guy Havura of Ramle, spoke for hours. At times, their discussion turned to politics.