For almost two decades, a conservative all-men’s pact has waited to have its political revenge on Angela Merkel.

On October 29, German Chancellor Angela Merkel announced that she was stepping down as leader of the Christian Democratic Party (CDU) after 18 years in that post. She also declared that she would not run for office after her term expires in 2021; if she completes it, she would be the second-longest-serving chancellors in recent German history after Helmut Kohl.

As the first woman chancellor of Germany and CDU chairperson, she has invariably changed the face of German politics and especially the centre-right. Throughout her years in power, her political success and perseverance have surprised many, especially those who helped her assume the CDU’s leadership back in the late 1990s.

At that time the party was facing a massive scandal after revelations that it had accepted donations from arms lobbyist Karlheinz Schreiber, which led to the downfall of both former Chancellor Helmut Kohl and party leader Wolfgang Schauble.

In the power vacuum and image crisis that followed, Merkel was seen as an ideal placeholder, who would step in and clean up the mess of party strongmen like Kohl, Schauble and former CDU treasurer Walther Leisler-Kiep, before they returned to take back the reins.

It was a classic case of “glass cliff“: a woman being given a leadership role during a time of crisis, when the chance of failure is the highest.

But once Merkel got her hands on power, she strategically maintained her grip on it for almost two decades. Now, after her decision to step down as party leader and eventually chancellor, the old boys’ club of the CDU are coming back with a vengeance, eager to undo her political legacy.

The ‘Andenpakt’

Lying in wait for Merkel to quit all these years was the so-called “Andenpakt” (Andes pact), an informal interest group within the CDU comprised of white conservative men.

The pact was created by a dozen CDU youth who had gone on an official visit to South America in 1979. On their flight from Caracas to Santiago de Chile (which flew over the Andes and gave the informal name of the group), they vowed to seek power together and help each other along the way.

Most of these men have similar socioeconomic backgrounds, were all born in West Germany, and are mostly Catholic. Their pact was quite successful and over the years many of them climbed the career ladder and landed powerful political positions, both on state and federal level.

Roland Koch, a staunch liberal-conservative with a pro-business agenda, became minister-president of Hesse, the financial powerhouse of Germany. Christian Wulff, more liberal in his agenda when it comes to social policy, but just as pro-business as Koch, was elected minister-president of Lower Saxony, the home state of Volkswagen. Friedrich Merz, who is now hoping to succeed Merkel, became chairman of the CDU parliamentary group, succeeding his mentor, Schauble.

In the late 1990s, the Andes pact was ready for the final step, to conquer the political heights in Germany – the CDU leadership – and form the next government. But it was just then that the donations scandal hit and spoiled their plans.

The rise of Helmut Kohl’s ‘little girl’

As the party reverted to damage control, Kohl and Schauble decided to push forward a fresh face. The shy East-German-born, liberal Protestant Angela Merkel emerged as the general secretary of the party. She had previously held offices that none of the ambitious Andenpakt members took seriously, such as minister for women and youth and minister of the environment in Kohl’s government, so none of them perceived her as a threat.

She was seen as the ideal, scandal-free face for the position of party leader who would head the CDU while it recovered from the scandal and while the Social Democrats were in power any way. No one imagined that she would hold onto the position for 18 years and rule as chancellor for 13 of them.

In fact, one of the advantages that Merkel had during her early political career was the fact that she was constantly underestimated by the men around her, including experienced politicians like Schauble and even Kohl, who used to refer to her as “Mein Madchen” (my girl).

Not seeing Merkel as a serious competitor, the CDU leadership nominated the Bavarian minister-president Edmund Stoiber to run for Chancellor in the 2002 elections over her. This was highly unusual, as it was customary for the party leader to also run for Chancellor. It was not as if Merkel did not want to run herself, but back then she still did not have the necessary political backing, partly due to the dominance of the Andenpakt.

Stoiber ended up losing the election, which ultimately paved the way for Merkel’s rise to power. Showing remarkable Machiavellian talent, she managed to outmanoeuvre most of her main opponents within the party. She not only sidelined Stoiber but also beat Merz to the position of leader of the opposition in the Bundestag.

Thus, Merkel came out of the 2002 election with two of the most powerful posts in the CDU. In 2005, she finally got her chance to lead her party in elections. After a modest success, she struck a coalition deal with the Social Democrats, becoming Germany’s first female chancellor.

In the subsequent years, Merkel continued to consolidate power within the CDU and many more Andenpakt members fell victims to her political schemes. Roland Koch, for example, fought many internal party battles with her, mostly concerning her push to liberalise the CDU’s conservative politics and move it towards the political left. In the end, he gave up, exasperated, and like Merz moved to the private sector.

Then there was Christian Wulff, the minister-president of Lower-Saxony. To neutralise him, she simply promoted him to the highly respected though politically powerless position of president of Germany.

Thus, Helmut Kohl’s “little girl” showed everybody that she knew how to play the power game better than many of the men who looked down on her and saw her as a politically harmless.

Who will succeed Merkel?

Throughout her 13 years in power, Merkel managed to build a name for herself nationally and internationally. She was named repeatedly “the most powerful woman in the world” by Forbes magazine.

She remained popular in Germany, even when she was pushing for policies her CDU’s conservatives despised, such as her decision to abolish conscription and to phase out nuclear power. In fact, as some observers have pointed out, her political success was very much due to her doing what the majority of Germans wanted.

However, this changed in 2015 with the refugee crisis. The influx of more than one million refugees from the Middle East and elsewhere had a tremendous impact on German politics. Merkel’s liberal agenda of open borders and her famous sentence “Wir schaffen das” (“We’ll manage it”) – turned against her and led to the spectacular rise of the far right, to which the CDU rapidly lost ground.

For the first time, she either misread the will of the majority of Germans or simply followed her convictions. Conservative critics and the conservative media jumped at the chance to criticise her once again; Merz called her refugee policy “catastrophic“, while Koch blamed her for increasing distrust among German citizens in the CDU-led government.

Although she still won the 2017 election, the refugee crisis marked a turning point in her career, which ultimately resulted in her decision to step down as CDU leader.

The upcoming election for a new party leader during the CDU convention in December is a chance for those in the conservative wing of the party to get their revenge after many years of being sidelined by Merkel.

Merz, who declared his readiness to take over almost immediately after she made the announcement, is currently the frontrunner. He seems to represent the hope of the conservative male-dominated party base to reclaim the CDU and turn its course back to conservative politics.

If he does win, it would be almost impossible for Merkel to maintain control over how and when she leaves office, something she has always said she wanted to have.

However, she is not going out without putting up a fight against her long-term Andenpakt adversaries. Running against Merz is Merkel’s protege, Annegret Kramp-Karrenbauer (also known as AKK).

AKK is a highly respected politician with a liberal agenda who supported Merkel in the refugee crisis. As a practising Catholic, she is more conservative when it comes to social issues (she was, for example, critical of same-sex marriage), but like Merkel, she is also flexible and treads a middle ground while offering some concessions to the party’s conservative critics. If AKK wins, Merkel will be able to serve out her full term as chancellor rather than being pushed out.

AKK is also likely to maintain some aspects of her mentor’s political agenda, including the push for gender parity within the party and government. During her time as party leader, the number of women in powerful political positions has grown significantly.

In the current cabinet, over 40 percent of ministers are women, whereas when Merkel served in Kohl’s last cabinet at the turn of the century, she was one of just two women ministers.

If Merz wins the internal elections, however, this and other liberal legacies Merkel has fought to push through would be in danger of being dismantled.

The views expressed in this article are the author’s own and do not necessarily reflect Al Jazeera’s editorial stance.