In an electric spice or coffee grinder or a mortar, grind the peppercorns and cloves to a coarse powder. Set aside
In a medium-sized, heavy-bottomed skillet or wide saucepan, heat 2 tablespoons of the oil to rippling over medium-high heat. Add the onion and garlic and cook, stirring occasionally, for 3-5 minutes, or until the onion is translucent. Add the tomatoes and the pepper-clove mixture. Reduce the heat to medium and cook, covered, for 12-15 minutes, until the mixture is lightly thickened. Let cool slightly and process to a purée in a blender. Set aside.
Season the chicken with salt and a good grinding of black pepper. In a Dutch oven or large saucepan, heat the remaining 2 tablespoons oil to rippling over medium-high heat. Add the chicken pieces and cook, turning once, until lightly golden, allowing about 3 minutes per side. Remove the chicken to a plate and set aside. Quite a bit of fat (rendered from the chicken skin) will now be in the pan; pour off all but 2 tablespoons. With a wooden spoon or spatula, scrape the bottom to loosen the flavorful browned scraps.
Return the pan to medium heat. When the fat ripples, add the capers and stir-fry for about 2-3 minutes, until they puff slightly and become brown and crisp. Scoop out and set aside.
Add the reserved tomato purée and cook, covered, for 15 minutes, or until the flavor is concentrated and the fat is starting to separate. Stir in the chicken stock, olives, raisins, apples, and all but about 1 tablespoon of the fried capers.
Add the reserved chicken pieces with any cooking juices. Bring to a boil and cook, covered, over medium heat for 20-25 minutes, or until the chicken is just done. (Actually, you’ll get best results if you add the leg pieces first, wait 5 minutes, and then add the breast pieces.) Taste for salt and add up to 1 teaspoon if desired (the capers and olives will provide some).
Stir in the sherry and cook about 5 minutes longer, until the raw alcohol taste is gone. Serve at once, with the remaining fried capers scattered over the dish. If you like, serve pickled jalapeños on the side.