Preheat the oven to 500°F.
Place the brisket on a work surface. If the fat cap is on the thicker side (1/2 inch) trim off a little of the fat, leaving an even 1/4 -inch layer.
Using a paring knife, make vertical incisions in the meat and shove a piece of garlic into each. Do this until the meat is stuffed with garlic all over.
Season both sides with salt and pepper and place the brisket in a Dutch oven starting with the fat cap facing up and brown it in the oven, about 10 minutes per side.
Remove the pan from the oven, and pour in the beef stock
Turn the oven down to 350 degrees
cover with a lid, and cook in the oven for 1 hour.
In the meantime, heat 1 tablespoon of olive oil over medium-low heat in a large skillet. Add the onions and sauté, stirring every once in a while, until soft and caramelized, about 30 minutes.
Remove the meat from the oven, and add the ketchup, sugar, paprika, smoked paprika, cayenne, thyme, rosemary, and bay leaves to the pan.
Whisk everything together with the beef stock.
Arrange the caramelized onions on top of the meat.
Place the lid on the pot and return it to the oven for 2-3 hours.
Remove the meat from the oven, and transfer it to a cutting board.
Slice the brisket against the grain into slices.
Return the meat to the sauce and serve, or store in the fridge overnight–the brisket can be made a day or two in advance.