Preheat the oven to 350°F (175°C).
Melt the butter in your cast iron skillet over medium heat. Add the water and cocoa powder, whisking until smooth. Remove from heat and allow to cool for a few minutes.
In a large bowl, combine the flour, sugar, baking soda, and salt. Gradually stir the cocoa mixture into the dry ingredients until combined.
Add the sour cream, eggs, and vanilla to the batter, and stir until smooth.
Bake the cake in the skillet for 18-22 minutes or until a toothpick inserted in the center comes out mostly clean.
While the cake is baking, prepare the frosting. In the same skillet (wipe it clean first, or use a small saucepan), melt the butter over medium heat. Add the cocoa powder and milk, stirring until smooth. Remove from heat and stir in the powdered sugar and vanilla until the mixture is smooth. Stir in pecans if desired.
Pour the frosting over the warm cake, spreading it evenly to cover the top.
Let the cake cool for about 15 minutes before serving. The frosting will harden slightly, creating that irresistible fudgy layer.