Catholicism as Poland's national religion
In 1717 Clement XI had his nuncio crown an icon of the Virgin as Poland's Queen. The Virgin was also made responsible for the military protection of Poland, with the official title of Hetmanka, Commander-in-chief. John Paul II continued the tradition of militant marianism when in 1981 he enlisted a statue of the Virgin to help combat communism. The Virgin had this role in Argentina, as well.
On the one hand, Mary is a powerful, sometimes militant, protector of Poland; on the other, she is an exemplar of feminine domesticity. [...] Marianism thus provides some of the glue that helps hold together two otherwise distinct strains of Polish national thought, one focused on maintaining conservative gender relations and the other on attaining victory in the international realm. 
Because she is the country's protector, the Polish concordat requires New Year's Day to be celebrated as The Festival of Mary. Even her image, Our Lady of Czestochowa which forms Poland's holiest icon, has military victories ascribed to it. This believed to have been painted by St. Luke on the Holy Family's table top. The scars on the Madonna's right cheek are clearly visible in the larger version. These wounds are said to have been inflicted by a Hussite (Protestant) who then fell to the ground and died in agony. So there. (The authenticity of this icon does not appear to have been impugned by the fact that in the 15th century it was “restored” by scraping off all the original paint....)
The next century brought further proof of the Virgin's martial prowess. In 1655, so the story goes, a Swedish army attacked the mountain-top monastery in which the icon was housed, but it miraculously held out. (In actual fact, the Swedes laid siege to it to try to extort 60,000 gold talars and left when the monks, secure in their impressively fortified stronghold, refused to hand any money over. ) However, the beleaguered Polish king, gave the Virgin's military potential the benefit of the doubt, bid for her protection and proclaimed her Poland's queen. In 1717 the Pope Clement XI, in an attempt to counteract the influence of Russia (and its Orthodox Church which didn't recognise him), had his nuncio officially crown this icon “Queen of Poland”.
Today Poland's national shrine to the Virgin on the mountain top at Czestochowa is one of the 10 most visited religious sites in the world with more than four million pilgrims annually.  In 2007 it was announced that one of the first destinations of the new Vatican airline would be the shrine of Czestochowa.
After Polish resistance ― under the banner of the Virgin ― was crushed in 1772, the country was divided up between Russia, Prussia and Austria. For over two centuries Poland disappeared from the map. With even the public use of the Polish language for the most part forbidden, only the Catholic Church still united the Polish people.  It wasn't until the end of WWI that Poland once again became a nation.
Events of the 20th century further strengthened the identification of Poland with Catholicism. The Polish victory over the godless Bolsheviks in 1920 was hailed as “the miracle of the Vistula” and attributed to the intervention of the Virgin. 
The rout of the Red Army by a popular early 20th-century painter depicts a curious cosmology. The battle rages on the ground — above that the Virgin presides over an indistinct “heavenly host” — and above them is the realm of the new reconnaisance bi-planes.  However, it's now known that contributing to the unexpected victory was a feat that remained unknown until recently. Thanks to the brilliant Polish mathematician, Jan Kowalewski, who broke the Russian codes, the Poles knew all the enemy's plans, which helped them to deploy their much smaller forces to “miraculously” good effect.
Demographic developments also encouraged religious nationalism. The Holocaust and the flight and expulsion of German and Ukrainian populations at the end of WWII made Poland almost uniformly Catholic. In addition, the Communist takeover in 1945 served to make the Church a rallying point for political opposition, even for the least religious Poles. Not surprisingly, therefore, surveys have found that “membership in the Church was, and still is, perceived as one of the most important features of belonging to the Polish nation”.  Its long sojourn behind the Iorn Curtain had kept the embattled Polish Church very conservative, cutting it off from the influence of Vatican II. An eminent Australian priest describes it as “the persecuted church of Poland with its fortress...mentality frozen in time”. 
With the election of a Pole to the papacy in 1978 the protectress of Poland also became the personal guardian of the pope. On his papal coat of arms John Paul II put the Virgin's initials in gold on a background of Marian blue. And after he survived an assassination attempt in 1981 on the anniversary of the Virgin's appearance in Fatima he was sure that she had deflected the bullet to save him.
The following year the Pope gave thanks at the shrine of Fatima for his survival, and publicly consecrated the whole world to the Virgin. Like his predecessor, Pius XII, he was convinced that “the Blue Army of Fatima” was destined to overcome “the Red Army of Satan”, and he attempted to align the whole globe with the ultimate victor.
During his convalescence John Paul II decided that the cryptic message of Fatima was that only the Virgin could defeat Communism. It was “the Blue Army of Mary and Christ, against the red of the world and of Satan”. Accordingly he had a chapel built on a hill on the eastern frontier of Poland and put a statue of the Virgin there. The statue resembled Our Lady of Fatima ― but with the addition of a crown, as befits the “Queen of Poland” ― and it stood resolutely facing Russia. 
Once the Virgin ― or at least her devotee, John Paul II ― had helped bring about the fall of Communism, the focus turned westward, with the Pope speaking of the re-evangelisation of Europe from the East. And Poland has indeed sent out evangelists to Western Europe in the form of Polish priests to minister to parishes abroad. It is claimed that about a quarter of all the young men training to be priests in Europe are now Polish and confidently asserted in the English press as late as 2006 that “Poland is bucking the Europe-wide decline in vocations”.  However, this source may be drying up, as the Polish Episcopate said in 2010 that over the past decade, the number of candidates for priesthood has declined by almost 30 percent. 
The Church has been able use Poland's long identification with Catholicism to assert its presence in public space. Crucifixes hang in both the upper and lower houses of Parliament, as well as in many other public buildings, including state schools.  And a cross to honour the memory of the “Polish pope” in Piłsudski Square was justified by appealing to the sense of national martyrdom:
The cross is a sign that expresses most fully the idea of Christianity, but also can be read as a symbol of suffering and victory of the Polish nation. 
After the fall of Communism, Polish bishops portrayed church-state separation as a leftover from Communism which should be swept away. This theme ran through the Sejm debate on adopting the concordat, where one speaker after another implied that those who opposed it must be anti-religious and anti-Polish. Ratification of the concordat was depicted as a rejection of communist tyranny, a step towards democratic freedom and an affirmation of Poland's Catholic identity. 
1. Brian A. Porter, "Hetmanka and Mother: Representing the Virgin Mary in Modern Poland", Contemporary European History, 14, (2005), pp 151-170. http://journals.cambridge.org/action/displayAbstract?fromPage=online&aid=315461
See also: Brian A. Porter, "Chapter 10. Mary, Militant and Maternal", Faith and Fatherland: Catholicism, Modernity, and Poland, 2011, pp. 360-390.
2. "Siege of Jasna Góra", Wikipedia. http://en.wikipedia.org/wiki/Siege_of_Jasna_G%C3%B3ra
3. "Pilgrim's Progress", Warsaw Voice, 8 August 2007. http://www.warsawvoice.pl/view/15493/
4. The period when Poland was divided among Russia, Prussia and Austria is called the Third Partition, 1795-1918. Outside of the post-1867 Austrian-occupied sector, even public use of the Polish language was forbidden. "The Polish Catholic Church and the State", Glenn E. Curtis, ed. Poland: A Country Study. Washington: GPO for the Library of Congress, 1992. http://countrystudies.us/poland/39.htm
5. Bishop-General Tadeusz Płoski, "Warszawa: Kazanie Biskupa Polowego WP wygłoszone w Katedrze Polowej w Uroczystość Najświętszej Maryi Panny Częstochowskiej" ("Warsaw: Field Bishop WP Sermon delivered at the Field Cathedral on the Feast of Our Lady of Czestochowa"), 26 September 2008. http://www.ordynariat.wp.mil.pl/pl/30_6369.html
6. The painting is "Cud nad Wisłą" ("Miracle on the Vistula") by Jerzy Kossak.
7. Krystyna Daniel, "The Church-State Situation in Poland Alter the Collapse of Communism", Brigham Young University Law Review, 1995, p. 402. http://religlaw.org/docs/religlaw_1254.pdf
8. Rev Eric Hodgens, “Reflections on an Ordination Golden Anniversary”, The Swag, December 2010. http://theswag.org.au/2010/12/reflections-on-an-ordination-golden-anniversary/
9. Dennis Barton, The Church in History Information Center, p. 33. http://www.churchinhistory.org/pages/booklets/apparitions.pdf
10. Luke Harding, "New migration fills British pulpits: Poland is bucking the Europe-wide decline in vocations, and its priests are in demand", Guardian, 15 March 2006. http://www.guardian.co.uk/world/2006/mar/15/religion.poland
11. "Decline in priestly vocations in Poland", Polskie Radio, 28 April 2010. http://www.thenews.pl/national/artykul130552_decline-in-priestly-vocations-in-poland.html
12. International Religious Freedom Report 2009, US Department of State. http://www.state.gov/j/drl/rls/irf/2009/127330.htm
13. Magdalena Hartman, “Warszawa: w konkursie na krzyż wygrał... krzyż”, (“Warsaw: where the competition for cross was won by … a cross”), Pardon, 6 October 2008. http://www.pardon.pl/artykul/6450/warszawa_w_konkursie_na_krzyz_wygral_krzyz
14. Sejm o ratyfikacji Konkordatu, (Sejm [debate] on ratification of the concordat), 12 December 1997. http://kronika.sejm.gov.pl/kronika.97.3/text/pl/ps-8.htm#b15