Puree the onion and garlic together in a high-speed blender until smooth.
Warm the olive oil in a wide braising dish over medium heat, then pour in the onion and garlic puree. Cook over medium heat the onion and garlic release their fragrance, and begin to color. Pour in the pureed tomato, and then turn the heat down to medium-low. Stir in the smoked paprika and drop in the herbs. Simmer, uncovered, until the flavors marry and the sauce thickens, about twenty minutes. Pluck out the herbs, adjust seasoning with salt, and transfer to a bowl.
Heat the oven to 350 F.
Butter your ramekins or cocottes, then line each cocotte with a slice of ham. Evenly distribute the sofrito into each of the cocottes, over the ham, and crack an egg over the sofrito. Bake until the white is set, but the yolk remains soft - about 8 minutes. Top with freshly chopped parsley and serve.
Notes
You can make the sofrito ahead of time, storing it in the fridge up to a week. Then simply assemble the eggs and ham ten minutes before you plan to serve breakfast for a quick and easy meal.