Make the caramel:
Bring 1/3 cup water to a boil in a small saucepan; keep very hot. Put the 1/3 cup sugar in a heavy-based 8-inch skillet or shallow saucepan. Set the pan over medium heat. Shake the pan to level the sugar and leave it alone until it’s about half melted. Shake and swirl the pan to help the sugar melt completely. Cook the melted sugar, constantly swirling or stirring with a wooden spoon, until it bubbles and turns a deep reddish caramel color.
Immediately take the pan off the heat and carefully drizzle the boiling water over the caramel. The mixture will sputter. Return the pan to medium heat; stir constantly with the wooden spoon just until the caramel is completely dissolved. Pour the caramel into a heatproof liquid measuring cup. Pour about 1/3 cup water into the empty caramel pan and return to medium heat until very hot, stirring to dissolve any remaining caramel. Spoon enough of this liquid into the measuring cup with the caramel to bring the level up to 1/2 cup. Let cool until warm. (You can make the caramel hours or even a day ahead. When cool, cover and leave at room temperature.)
Make the cupcakes:
Sift the flour, baking powder, and salt into a small bowl. In a large bowl, beat the butter with a stand mixer fitted with the paddle attachment (or a hand mixer) on medium speed until smooth, 30 to 60 seconds. With the mixer running, slowly pour in the remaining 3/4 cup sugar, stop the mixer, and scrape the bowl and beaters. Beat on medium-high speed until light and fluffy, about 2 minutes. Beat in the eggs, one at a time, on medium speed until the batter is smooth, 30 to 60 seconds after each addition; scrape the bowl each time. Beat in the vanilla. On low speed, add the dry ingredients in three installments, alternating with the caramel. Mix only until the batter is smooth.
Divide the batter evenly among the prepared muffin cups. (Use two rounded soupspoons: one to pick up the batter, one to push it off.) Don’t smooth the batter. Bake until the cupcakes are golden brown and spring back when gently pressed in the center, 18 to 20 min. Let the cupcakes cool in the tin for 5 min. on a wire rack. Carefully remove the cupcakes from the tin, set them on the rack, and let cool completely.
Spoon a slightly heaping tablespoon of the frosting on top of each cupcake and use the back of the spoon to spread and swirl the frosting. If the frosting starts to stiffen, rewarm it briefly over medium-low heat until it’s spreadable.
Holding a cupcake by its liner, dip it into the chopped pecans, if using, and turn it gently all around to coat the frosting thoroughly with the pecans. Repeat with the remaining cupcakes. (Save any leftover pecans for another use.) Let the frosting set for about 30 min. before serving.