This pasta is from the region of Lazio, around Rome. Some sources believe the dish was developed at the end of World War II, when American soldiers stationed in Rome brought rations of eggs and bacon to Italian friends who turned them into this pasta sauce. Other sources suggest that it originated with coal miners (carbonari) in the region. It may be made with either pancetta or guanciale. Both are cured pork products: Pancetta is made from the pork belly, guanciale from pork jowl. Bacon (which, unlike guanciale, is smoked) is not commonly used in Italy. But it frequently appears in this dish in the United States.
The pancetta or guanciale should be cooked just to render the fat but not until crisp. The egg yolks, which serve as a liaison to thicken the sauce, are whisked with cream, then cooked with the spaghetti — to ensure that the sauce is hot — but only briefly; exposure to heat will eventually scramble the eggs and ruin the smooth consistency of the sauce. (Cream is not traditional but it is often used because it prevents the eggs from scrambling.)
Bring a large pot of salted water to a boil over high heat.
Combine the diced meat, garlic, and oil in a skillet and cook over medium heat. After 1 minute, add the red chile pepper flakes. Continue cooking until some of the fat is rendered but before the meat crisps, 3-5 minutes.
Cook the spaghetti in the boiling water until slightly undercooked, about 5 minutes.
Meanwhile, in a large bowl, whisk together the eggs, egg yolks, cream, if using, and black pepper, to taste.
Drain the spaghetti, reserving about 2 cups of the pasta water, and add the spaghetti to the skillet. Add enough pasta water to the pan to bathe the spaghetti, and simmer until pasta is al dente and the water is reduced. Discard the garlic.
Transfer the spaghetti-bacon mixture to the bowl with the egg mixture. Add the cheeses and toss well to combine. Return the mixture to the skillet and toss over medium-low heat for 30-60 seconds to warm and slightly thicken the sauce; do not overcook or the egg will scramble. Taste and adjust the seasonings. Serve hot.