It really started in January 754 AD when Pope Stephen II and King Pepin of the Franks concluded an alliance that made Pepin "Patrician of the Romans" (a title formerly held only by the highest Byzantine officials in Italy) and that purported to make him and his successors in perpetuity responsible for protecting Papal territorial claims in Italy. Through the centuries and in the face of many vicissitudes, various Popes called on the Franks to make good on this alliance. By the middle of the 19th century it fell to Napoleon III to protect what had become the Papal States. Napoleon III had supported the Italian nationalists against the Austrians but he found that effort, although successful, too costly. Eventually, he had made a separate peace with Austria. Now, because of the requirements of that long-ago agreement made by Pepin and of the long tradition of French support for the Popes, he was on the other side of the barricades defending Pius IX against the same nationalist insurgency.
But Napoleon III also had problems elsewhere: all of Europe was up in arms, and revolutions and wars were in the air. The jockeying for power among the Europeans had already led to some unexpected results, including the Mexican War and the annexation of Texas to the US in the Western Hemisphere. The bigger events in central and northern Europe had also forced the European powers to withdraw their troops from Italy, and, by 1861, all of Italy except for Rome and Venetia had achieved independence and sent delegations to the "Italian" Parliament meeting in Turin. There, on March 13, Victor Emanuel II was proclaimed King of Italy. Venetia was added to the new Italian Kingdom in 1866 as a result of Prussian successes in the north.
That same year, Napoleon III withdrew the French garrison that had sent to Civitavecchia to protect the Pope in Rome: after long negotiations he had made an agreement with the new Italian Kingdom to do so, and he also knew he would need every soldier he could find for the defense of French territory after Prussia finished its forcibly unification of Germany. A weak French "foreign legion" was organized for Rome's defense, but it was not enough to keep Garibaldi and his insurgents from attacking the Papal States in the autumn of 1867. (Garibaldi was essentially freelancing at this time and not really under control of the Italian government.) Napoleon spared two divisions for the Pope and sent them back to Rome. They combined with the Pope's own troops and repulsed the Garibaldi attack.
But on July 20, 1870, the long expected Franco-Prussian War broke out and Napoleon III desperately needed those troops from Rome. The French divisions withdrew from Civitavecchia on August 19, but they were too late to help Napoleon's cause. Napoleon asked Italy for help against the Prussians, banking on his past support of Italy against Austria, but the Italians refused because of Napoleon's more recent support for the Pope. Napoleon III and his whole army were quickly overcome and he himself was captured at Sedan in north-eastern France on September 2. News of his capture reached the Italian government the next day, and the Italian army immediately marched on Rome, which now could expect no outside assistance. Victor Emanuel made one last plea to Pope Pius IX to settle the matter peacefully, but the Pope refused.
Without French help, the Papal forces in Rome were no match for the Italian Army. On September 20, after a few hours' bombardment, the Italian troops entered Rome through a breach in the Aurelian Walls at Porta Pia. They advanced down what is now Via Septembre XX toward the Papal residence at the Quirinale Palace, but they moved slowly enough to ensure the Pope's escape. The Pope and his court decamped and safely reached the Vatican. There, he and his successors remained as "Prisoners of the Vatican", resisting the 1871 Law of Guarantees (an Italian offer to provide for the safety of the Pope and to leave all religious authority in the hands of the Church) and all subsequent attempts to settle the question of how Italy would coexist with the Papacy. (See P.S. 2.)
That situation maintained until 1929 when the Lateran Treaty creating a new sovereign entity, the Vatican State, was signed by Mussolini's Italy and the Pope's representatives. By the same agreement, Catholicism became the state religion of Italy. The latter provision was dropped from a new Lateran Treaty in 1984.
There are two Museums to visit. The larger is the Central Museum of the Risorgimento, behind the Victor Emanuel Monument on Via San Pietro in Carcere. A much smaller museum commemorating the Bersaglieri Infantry unit that breached the wall at Porta Pia is actually in the Porta Pia at Piazzale Porta Pia, 2.
There are hundreds of books in Italian and in English on the Risorgimento, and some older general histories of Italy have quite useable sections of for the non-specialist. Histories written before World War II tend to give more detail on the Risorgimento, perhaps because the romance of the movement was still fresh in academic minds or because later historians felt it was necessary to use so many more pages for explanations of Fascism.
A Risorgimento outline -- follow links: http://members.xoom.com/mseaborn/hist/html-nodes/subject-notes/italy.html. Includes a link to a very brief sample of Risorgimento historiography.
History of Italian Unity (in Italian): http://www.evo.it/riccati/risorgi/intro.htm
National Museum of the Italian Risorgimento (in Italian): http://www.regione.piemonte.it/cultura/risorgimento/sale.htm
Il Risorgimento (in Italian): http://www.bdp.it/~caps0001/risorg2/main.html
P.S.: 1. The Risorgimento story, including the events surrounding the 1870 seizure of Rome, is told in Rashomon versions. In addition to the non-Italian interpretation given above, which highlights the importance of foreign events, there are numerous Italian interpretations. Italian nationalist (including monarchist) versions minimize the influence of foreign events and speak proudly of brave home-grown heroes winning alone against almost impossible odds. There have been two major trends in the nationalist version: the traditional, which posits a smooth and friendly relationship among the nationalist factions, and the revisionist, which dwells on the friction, treachery, etc., among the nationalist groups ("My nationalist group won the Risorgimento despite all the evil done by those other nationalists.") The Fascist view was essentially the earlier nationalist view, but with any liberalism erased. Italian Marxists still say the whole Risorgimento was just another example of a nationalist, middle-class movement and that Italian unification perpetuated the suppression of the working class. There are, of course, two Church versions, one pre- and the other post-1929.
Historical disputes of this kind are so common that it was necessary to invent a sister-discipline for History called Historiography, which lists and comments on the opinions and versions of disagreeing (and often very disagreeable) historians. There are now even academic courses on "The History of Historiography." It could go on forever.
P.S.: 2. The Popes, in rejecting the Law of Guarantees and other offers from Italy, were not just being stubborn. They wanted, and eventually got, sovereign recognition and an agreement in the form of a treaty. A treaty would have the backing of International Law and could not easily be unilaterally revoked, whereas a subsequent unfriendly Italian King or perhaps a leftist or otherwise anticlerical Parliament could simply reverse an Italian law, such as the Law of Guarantees.