Just like the text says, what made Venice great? How did it last for so long? What was the importance of the Battle of Lepanto to Venice specifically? Did it play any role in the creation of the USA, or the French Republic?
I'm definitely not qualified to answer all of your questions but Venice had a few very interesting traits. For one, it had no land to speak of and as such relied on trade for food and other land based necessities. The city itself was created by people essentially seeking refuge from the tumoltuous tides of Lombard and other raiders on mainland Italy, so you have the strong nationalistic pride but also communal atmosphere where they would very much band together for the good of the comune (for example their support of ship building and preparation for the fourth crusade, literally halting all economic activity for the sake of honoring a deal made by the Doge). I think these and a very heavy leaning to success through dominating trade rather than dominating land are some of the things that make them so unique.
Trade and prowess on the sea made them great. In their day they were involved in a fierce competition with other maritime powers such as Genoa for ownership of the Mediterranean and it's trade. In some respects, the Mediterranean was the seat of world trade between the fall of the Romans (hell even during antiquity) and the discovery of the new world. The book "Venice: City if Fortune" brings up one very interesting point to their loss of power in that they started a downward trajectory around the time of the discovery of America and the opening of new world trade. I found this very logical as it simply meant the wealth now lay somewhere that they weren't capable of really dominating in the same way they at times had a strangle hold on Med or Black Sea trade. Geographically they were no longer in a great position to have so many trade lines run through them.
There are two key things that made Venice strong, in my opinion (which is not that of a trained Historian, but as an amateur whose ancestors herald from Venice and who has read a lot on Venice):
In terms of Location, Venice sits as far in to Central Europe as you can get from the Mediterranean, which makes it a great stopping point for ships with goods to stop and debark. Genoa is in a similar situation, just a bit more to the West. Genoa would come to be a great rival of the Venetians as they both jostled for trade.
Much of that trade came from (or through) the Middle East and Egypt. Spices and other valuable goods from beyond the Middle East were traded by Muslim traders from the coast of India, across the Arabian Sea, and then up the Persian Gulf or Red Sea. From there, short overland trips were made to ports along the Mediterranean (one key port being Alexandria in Egypt). Those goods were then loaded on ships which made their way to European markets where they could fetch large prices.
Moving goods by boat is much easier than by land, if you have the resources to build and maintain boats. Going 200 miles by boat is a few days and you can carry a tremendous amount more than if you had to carry those goods (by horse/pack animal). Naturally, you want to get your goods as close as you can by sea before taking them off the boat for the slower and more difficult final land leg of your journey.
Venice is situated perfectly to be at this sea-land debarking point. Because of it, the city grew in to its role as Trade Empire.
Trade became mostly state-oriented (i.e., the Republic of Venice bought and built boats, hired sailors, sent them out, and collected the income). This was one of the key differences between them and Genoa (where most trade was by private merchants). For sure, people made their own fortunes in Venice, but the stat was run by the Noble families, so those profits intermingled and for the sake of brevity I am just going to address everything as being 'Venice'.
Because trade was run by the state, it meant that the state could spend resources on standardizing recordkeeping, on optimizing routes, on calculating down to the individual crossbow quills what was needed per voyage to maximize trade. Their deep access to Central Europe and their reasonable sail to Mideast ports meant they could meet the needs of the growing European markets. They grew fantastically rich and those riches begat more riches as scale afforded them competitive advantages over the other traders of the Mediterranean.
Venice became a sharp and chiseled bureaucracy. Skimming off the top of a shipment was a capitol offense. The families who ran Venice became outrageously wealthy as well, so there was never any serious internal machinations or unrest. However, life in the terraferma -- the land outside of Venice under Venice's control -- was not so great. Cyprus was seen as a means of productive wealth, not as a client state. Zara and the Dalmatian Coast were put under thumb mostly out of anti-pirate measures. Rhodes and Lepanto and other ports were mostly used as means of protecting their trade routes.
Venice additionally built ports near regions it wanted to buy or sell from, such as in the Black Sea. Because of this, Constantinople was of great importance (as it sat at the only route in to the Black Sea). This importance led to the craziness that was the Fourth Crusade (where Venice redirected the Crusaders in to an attack on Genoese-influenced Constantinople, taking the city and installing a puppet Emperor -- this is where Venice got its 4-horses for St. Marks).
When trade found other ways around. In the early 1500s, Portugal managed to make it around the Cape of Africa and up the coast in to the Arabian Sea. From there, they established forts and began to send/receive great trade fleets laden with cheap spices and riches from India, cutting Venice out of the deal.
Additionally, the fall of Constantinople in 1453 to the Ottomans means that Venice now had to tread lightly -- sometimes being fully locked out of Mideast trade (and fully locked out of the Black Sea trade when the Ottomans wished them to be). Compounding this were the Mongol Khan empires and Tartars attacking their port cities on the Black Sea coast.
Venice was put in to a weird spot of having to placate the Ottomans (Muslims) while also showing a Christian face to their European counterparts. When swords and sabers were rattling between West and Mideast, Venice was stuck in the middle trying to keep its trade routes running. Unfortunately for Venice, this came to a head with their giant naval battles with the Ottomans. The Battle of Lepanto (and the Siege of Malta) were important to try to cut off Ottoman naval power; but despite the Christian League's victory, history had begun to move past Venice. Portugal and now the Dutch were circumventing the Mediterranean entirely for Eastern goods, the Ottomans made the more direct trade near impossible, riches were flowing in from the West, and the rest of Europe was beginning to move outwards, away from the central sea that had been so important and so vital to Venetian success.
Venice declined, lost ports, and retreated back to their homes on the lagoon. The city still had money and riches, but The Battle of Lepanto was, in my opinion, their last great hurrah. Their geographic centrality that had built them was now their cage. Stuck in the very middle of the Mediterranean, Venice could not hope to rival the rest of the colonizing Europeans as the riches of the world poured in to Atlantic ports.
Like any polity with a long history, there's no single reason. There were a number of factors, each closely related, some of which I will briefly outline below. I’m going to assume you’re already familiar with the broad lines of polity’s transition from a municipal (lagunical?) government to the government of a sovereign state. Feel free to ask follow-ups to clear any doubts up.
1. Convenient geography.
Coastal northeastern Italy was a Byzantine Military outpost up until Ravenna fell to the Lombards in the eight century. When Ravenna was under siege in 751, no Consul was appointed to govern the lagoons that year. The people elected their own Dux, or leader (a title which would quickly be corrupted in the local Vulgate, to "Doge"). When Ravenna fell and what was left of the Byzantine army evacuated to Bari, this man (Teodato Orseolo) found himself the ruler of an independent polity.
Why were the lagoons left alone? They weren't. Not long after the Lombard conquest of Ravenna, the Lombard Kingdom of Italy turned its attention to Rome. Pope Adrian consequentially called to the Franks for aid, and Charlemagne spared no time to descend onto Italy and make quick work of the Lombards, asserting himself in northern Italy and granting the Papacy a large temporal territory to govern. Pepin, Charlemagne's son and successor as King of Italy, later attempted to occupy the lagoon (long story).
How effective the armed citizenry of the Lagoons could be against the landed-warrior-levy of the Franks is up for speculation: a decisive battle was never fought. Pulling up buys and markers so that only the most experienced navigators could sail in the shallow waters of the lagoon, the Venetians limited Pepin to the islands of Chioggia and Pellestrina in the southern lagoon and Grado, Jesolo and Eraclea to the north. But once the King arrived in the channel of Malamocco, he found sharp stakes driven into it, making easy crossing impossible. The Venetians pelted the Franks with arrows as they tried to wade the waters, and the Franks soon withdrew. They found they had to crowd onto the thin island of Pellestrina (which was obviously not nearly as built up as it is today) and stay out of sight of the shore: the Venetian boats circled them like hungry sharks, their arrows picking them off one at a time (and when the Franks were looking particularly short on supplies, the Venetians would throw bread at them). Eventually, Pepin negotiated to have a large tribute paid to him and left.
So it certainly helped the early Republic that the communities of Malamocco, Eraclea and Grado were each separated by the mainland by lagoons up to 500km^2 of brackish water. Sure, the lagoons are only waist-deep in most places, but approaching an enemy over nearly two hundred square miles of open terrain while loudly splashing is possibly the worst way to start a battle. Plus, the lagoons are crisscrossed by deep channels, so traveling in a straight line is never feasible.
Pepin's year-long siege had the effect of accelerating the urbanization of Venice, as people living in communities along the edges of the lagoon took refuge on the central Realtine Islands. In the eight and ninth centuries the modern dense city of Venice was still a fray cry away: we're still looking at a series of disconnected islands with people living in thatched roof houses facing the water and orchards and vegetable gardens instead of paved streets out back. These islands were: Rio Alto (high banks, today near the eponymous bridge) Spinalunga (modern Giudecca), Lupario (the aria around San Giacomo Dell'Orio) and Olivolo (modern castello).. The City of Venice wouldn't be recognizable until at least the 10^th century (architecturally, until the 15^th).
The lagoon would prove a valuable defense time again: In the 9^th century, when the Hungarian horde rampaged across northern Italy, it eventually set its sights on Venice. Doge Pietro Tribuno spared no time into preparing the populace for war. As Pepin had done the previous century, the Hungarians rapidly made their way up the island of Pellestrina, only to be halted at the channel of Malamocco. There they attempted to cross on coracles, which were easily rammed by the Venetian ships storming down the straight at full sail. The victory was quick and compete.
To attack the city of Venice, only once option is viable: Water. But it's not enough to be an expert navigator, you need to know the tides or you'll run aground: the a war in 1379 a Genoese fleet (expert navigators) got as far as the island of Chioggia inside the lagoon intending to lay siege to Venice, but the Venetians (whose fleet of war galleys had been defeated and were relying on commandeered civilian boats) were able to hem them aground on Chioggia and quickly surround them.
Thus, protection from invaders all but assured, the inhabitants of city of Venice could dedicate themselves entirely to maritime trade and enriching themselves and their republic, slowly under the centuries extending their economic influence into political matters, first establishing overseas colonies, and eventually becoming a powerful force on the Italian Manland. I can’t get into the details of every single expansion (pick up good old J. J. Norwich’s History of Venice for just that) but we can get into the details of where Venetian political power stemmed from.