We believe in a sole and constant general law. Therefore we also believe in a sole and constant general objective, and we believe in progressive development toward this given objective, which can only be achieved by means of coming closer together-that is, through association. All human faculties and strengths are affected by this development. Finally, we believe that the combined work of all these human faculties, once they are fully developed and can thus be converted into active forces, will lead to the fusion of all members of Humanity in the awareness of a common origin, a common law, and a common goal. In this way, the great edifice that the centuries and the peoples are called to erect will vaguely resemble a pyramid whose top can touch the sky and whose base embraces Humanity as a whole. God's eye will radiate from the peak of this pyramid.
The word that will scientifically define all this is: Unity. And we mean unity in the widest, most comprehensive, and most profound possible sense. Unity in heaven and on earth, unity in every single part of this earth, unity in Humanity, and finally unity inside every human being. We believe that our Universe must necessarily be organized in a concentric manner. Everything in existence is thus only a more or less extensive, civilized, or perfect manifestation of the same principle. Every part of this grand whole and every being, no matter how small, exists and lives by virtue of a single and constant law. Every living being thus embodies the same law of the Universe, and what varies is just the scale. Each man is a miniature version of humanity, like the earth is a miniature version of the universe. If this were not the case, there could be no progress, no humanity, and no harmony. There would be nothing.--G. Mazzini (1836) "Humanity and Country" translated by Stefano Recchia, 55
One reason to return (recall my pieces on J.S. Mill here and here) to the nineteenth century roots of liberal democracy is that it was articulated and defended morally alongside a robust moral defense of nationalism (against the more universal aspirations of the Catholic Church and various empires [cf Lord Acton]). One natural question to ask of nineteenth century liberal, democratic nationalists is how to reconcile potentially competing claims and aspirations of different (would-be) nations. There are liberal nationalists who echo, say, Addison or Kant, and who will insist that trade will create shared interests (and culture) and even a cosmopolitan and pacific outlook (recall). But it is not obvious why peace is the natural effect of international trade because it also creates more sources of friction.
Mazzini, one of the great heroes of liberal, democratic nationalism, offers a very different approach. In the first paragraph above, he very clearly embraces a picture of divine providence, by way of the Eye of Providence ("God's eye...peak of this pyramid,") familiar from the US$ note.* Within this providence there is a single moral law and nations are a (temporary useful) means toward making progress in actualizing the moral law whose end (humanity--this has, as Jacky Taylor, Kate Abramson, Remy Debes, and Ryan Hanley have shown its roots in a somewhat less providential philosophy developed by Hume and Smith) is a common good for all of humanity. (In subsequent paragraphs, Mazzini has separate arguments for why in the nineteenth century cosmopolitan associations would not be effectual.)
For Mazzini, morality is an one of the most powerful and durable "active forces" that guide individual and group human behavior. Throughout his writings, Mazzini rejects the view that humans are not motivated to act on morality. On the contrary, he thinks that we are prevented from doing so largely because of other (passive) forces (violence, bad customs, bad education, etc.). For Mazzini, then, a nation worth having can be a moral community. The way to become a moral community is to convert passive forces into active force (which is to teach and cultivate the moral law).
In the second quoted paragraph, Mazzini embeds this idea of progressive moral development in a larger metaphysics of "God and Humanity" (56) which is reminiscent of Leibniz. To be sure, I am not claiming that Mazzini is directly inspired by Leibniz. He is echoing ideas on the mirroring of microcosms and macrocosm that would have been familiar to any student inspired by reflection on (the tradition of) the great chain of being.
Mazzini's claim is not that God will prevent conflict among distinct nations. Nor does he argue that what's required for mutual peace is religious faith. Rather, he is suggesting that nationalism itself needs to be transformed such that what it aims for in each state is not the "weakening of everything that does not promote one's narrow self-interest, but rather the improvement of all through everyone's contribution, the progress of each for the benefit of all.." (61; Mazzini is not against enlightened self-interest properly understood.) That is, nationalism becomes an active force in the universe that advances even civilizes a national culture. (It does so, in part, by respecting and promoting individuality: Mazzini argues that we have a "right to liberty in everything that is necessary to the moral and material sustenance of life: personal liberty; liberty of movement; liberty of religious faith; liberty of opinion; liberty of expressing that opinion through the Press or by any other peaceful means; liberty of association, in order to render that opinion fruitful through contacts and exchanges with others; liberty of labor; liberty of trade." (97))
It should be clear, then, that Mazzini's defense of nationalism is very qualified: it's a moralized nationalism--a morality founded on heavy duty, metaphysical principles: the great chain of being (see Lovejoy), the principle of harmony, divine providence, etc. Notably: according to Mazzini, the alternative to these principles is nihilism: "there would be nothing."
Even if one were to grant Mazzini's metaphysics, there is a tension, however, in Mazzini's position. Nations are needed to convert and develop passive forces into an active forces. They are a stage in human development that is to be overcome providentially through the growth and cultivation of (properly moral) national institutions. But for peace to reign among these nation-states during this development, these nations need to be governed by the moral law. Yet, the very condition needed to generate such peace among states is also the principle that would make states not needed anymore; at the point in which nation states would be governed by the moral law, the "fusion" of humanity could take place. So, Mazzini is going to to need second-best principles that govern the conduct among developing nation states--we may understand his ideas on a European federation as an articulation of these, subsidiary principles
*It's possible that Mazzini is also making a reference to freemasonry here, but the evidence is not very strong.