Finely chop the pancetta after removing any rind; finely grate the pecorino and parmesan and mix together.
Beat the eggs in a medium bowl and season with a little freshly grated black pepper; set aside.
Add 1 tsp salt to the boiling water, add the spaghetti and, when the water returns to the boil, simmer covered for about 10 minutes until al dente.
Squash the peeled garlic cloves with the blade of a knife to bruise them.
While the spaghetti cooks, melt the butter in a large frying pan or wok, then add the pancetta and garlic.
Cook on medium for about 5 minutes, stirring often, until the pancetta is golden and crisp; remove and discard the garlic.
Lower the heat under the pancetta to low. When the pasta is ready, lift it from the water with a fork or tongs and put it in the frying pan with the pancetta, allowing some pasta water to come with it.
Mix most of the grated cheese with the beaten eggs, keeping a small handful of cheese back for sprinkling.
Take the pan of pasta and pancetta off the heat and quickly pour in the eggs and cheese, lifting the spaghetti so it mixes and the sauce thickens without scrambling.
Add extra hot pasta cooking water, several tablespoons at a time, to loosen the sauce until glossy and saucy; season with a little salt if needed.
Plate by twisting the pasta with a long-pronged fork, serve immediately with the remaining cheese and a grating of black pepper; add more hot pasta water if it dries before serving.
Tips
Grate the cheeses and beat the eggs before cooking so assembly is quick and smooth.
Use reserved hot pasta water to loosen the sauce and keep it silky rather than watery.
Serve immediately with extra grated cheese and a fresh grind of black pepper for best texture.