Make the apples: In a 10-inch sauté pan, melt the butter over medium heat. Add the apples, brown sugar and salt, and cook, stirring occasionally, until the sugar dissolves and the apples soften slightly, 4 to 5 minutes. Let cool to room temperature.
Heat the oven to 350 degrees. Grease a 10-inch oven-proof skillet with butter.
Make the cake: In the bowl of an electric mixer fitted with the paddle attachment, cream the butter and brown sugar until light and fluffy, 4 to 5 minutes. Add the eggs one at a time, beating well after each addition, and mix to combine. Scrape the bowl well, then beat in the vanilla.
In a medium bowl, whisk the flour, baking powder, salt, cinnamon and nutmeg to combine. Add the flour mixture to the mixer and mix just until incorporated. Scrape the bowl well.
With a rubber spatula, gently fold the apple mixture (including all of the caramel-like liquid in the pan) into the batter. Mix just until incorporated.
Pour the batter into the prepared skillet and spread into an even layer. Bake until the surface is evenly golden brown and appears set – a toothpick inserted into the center should have a few moist crumbs clinging to it, 30 to 35 minutes.
It’s better to slightly undercook.
Let cool completely.
Make the frosting: In the bowl of an electric mixer fitted with the paddle attachment, cream the butter and confectioners' sugar until light and fluffy, 4 to 5 minutes.
Place the caramels in a microwave-safe container. Microwave in 20-second bursts, stirring, until the caramel is warm and fluid. (This mixture will cool quickly, so be sure to do it just before you mix the frosting.) Add the warm (not hot) caramel mixture and mix on medium speed until incorporated. Scrape the bowl well.
Add the cream and vanilla and mix to combine. The frosting should be smooth and very soft. Scoop the frosting onto the cooled cake, and spread into an even layer. Garnish with flaky salt just before serving.
The cake can be made up to 2 days ahead. Leftovers can be stored at room temperature for up to 5 days.