What caused the Years of Lead in Italy? Was it a remnant of the partisans during the Civil War?
Not really, although the wartime partizans might have been a source of inspiration for groups like the Red Brigades. In fact, Italian Partisans went on to serve as members of parliament adhering to a various post-war political parties. It is certainly fair to say that the bulk of the early Italian Communist Party (Partito Comunista Italiano, or PCI) was made of former partisans, but the PCI was expressly included in the first post war government to avoid more civil conflict in Italy and the PCI itself denounced armed struggle.
The causes of the years of lead are complicated; I will focus on the political ones. There were a multitude of factors which led to the emergence of radicalized political violence in Italy in late 1960s which carried over in the 1970s. The strongest was the coming-of-age of a post-war generation: much like in the rest of the west, in the 1960s Italian universities became hotbeds of activism and distrust towards the establishment. Protests and occupations of public buildings became common. However, uniquely to Italy, this distrust was not limited to the ruling party, in this case the Christian Democracy party (Democrazia Cristiana, or DC), but also extended to the opposition PCI.
Although it initially seemed that the Communists would be habitual partners in government, all though the 1950s and 1960s the PCI was expressly excluded from governing coalitions. Electorally, the party was stagnant a around 22%, however a strong network communist-aligned of unions, university professors, and public sector administrators had over two decades created the impression that the Communist party was just as mainstream as the Christian Democrats. There is a famous picture of a student activist in front of a spray-painted wall denouncing all professors, "Be they white [christian], red [communist], or striped [both, presumably depending on the times]."
The communist party also had an increasingly complex relationship Soviet Union: it was becoming difficult for the PCI to justify increasingly evident oppression in the Eastern Block. In 1958, the communist party's general secretary Palmiro Togliatti began advertising "The Italian Way Towards Socialism," however there continued to be a loud and sometimes embarrassing pro-USSR faction within the party. The Christian Democratic party rhetoric continued to label the PCI as a party that would have Italy adhere to the Eastern Block, which prompted the counter-accusation that the Christian Democrats were selling the country out to the United States. This kind of dialogue fueled both right-wing nationalist extremists as well as radical marxists, who interpreted both political parties as being under the yolk of foreign powers.
The equivalency between the PCI and DC led to radicals at the ends of both sides of the political spectrum to mobilize violently. After twenty years of promising a proletariat revolution through electoral means, the PCI not only didn't seem any closer in achieving their goals, but they increasingly seemed a part of the establishment, prompting the more radical elements in the party to form violent splinter groups. This, in turn, inspired violent right-wing groups.
I wrote a previous answer about the PCI's response to the years of lead framed within the wider PCI relationship with the USSR; in short, they continued on their centrist trajectory, prompting the creation of splinter-parties even farther to the left mirroring the violent extraparliamentary groups. You can read that here. I also wrote another post on the PCI's "Eurocommunist" ideology that framed its move closer to the DC.
If you'd like to read more, you can look at the relevant chapters in the following books:
Ginsborg, Paul. A History of Contemporary Italy: Society and Politics, 1943-1988. London, England: Penguin, 1990
Gibert, Mark. Cold War Europe: The Politics of a Contested Continent. Lanham, Maryland: Rowman and Littlefield, 2015
Gilbert, Mark. The Italian Revolution: The End of Politics, Italian Style? Boulder: Westview. (especially the first few chapters)