Heat the oven and prep the pan: preheat the oven to 350°F. Grease a 9-inch springform pan (or a 9x9-inch square pan) and line the bottom with parchment paper.
Make the crumb topping first: in a medium bowl, whisk together the flour, brown sugar, cinnamon, and salt. Add the cold butter cubes and rub or cut them in with a pastry cutter or your fingers until the mixture forms pea-sized crumbs with some larger clumps. Refrigerate while you make the batter — cold crumbs stay crumbly in the oven.
Whisk the dry ingredients: in a medium bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
Cream the butter and sugars: in a large bowl, beat the softened butter with the granulated sugar and brown sugar on medium speed for 2 to 3 minutes, until light and fluffy.
Add the eggs and vanilla: beat in the eggs one at a time, then the vanilla, scraping down the bowl as needed.
Finish the batter: mix in the sour cream, then add the dry ingredients in two additions, mixing on low just until no flour streaks remain. Fold in the diced apples with a spatula.
Assemble: spread the batter evenly in the prepared pan. Sprinkle the chilled crumb topping generously over the top, pressing it very lightly so it adheres — do not press it into the batter.
Bake: bake at 350°F for 50 to 55 minutes, until a toothpick inserted in the center comes out with just a few moist crumbs and the crumb topping is deep golden. Tent loosely with foil for the last 10 minutes if the top browns too fast.
Cool and glaze: cool in the pan for 20 minutes, then release the springform ring (or lift out by the parchment) and cool for at least 30 minutes more. If using the glaze, whisk the powdered sugar, milk, and vanilla until smooth and drizzle over the cooled cake before slicing.