Preheat the oven to 350°F. Grease a 9x13-inch baking dish or spray it with nonstick cooking spray.
Combine the dry ingredients. In a medium bowl, whisk together the flour, baking soda, salt, and apple pie spice.
Cream the butter and sugar. In a large mixing bowl, beat the softened butter and granulated sugar until light and fluffy, about 2 to 3 minutes.
Add the eggs and vanilla. Beat in the eggs one at a time, then mix in the vanilla extract until combined.
Finish the batter. Gradually add the dry ingredients to the wet ingredients, mixing just until combined. Fold in the diced apples with a spatula. The batter will be very thick.
Bake. Spread the batter evenly into the prepared baking dish and bake for 40 to 45 minutes, or until a toothpick inserted into the center comes out clean.
Make the caramel glaze. While the cake bakes, combine the butter, brown sugar, and milk in a small saucepan over medium heat. Bring to a gentle boil and cook for about 2 minutes, stirring constantly. Remove from the heat and stir in the vanilla.
Glaze the cake. While the cake is still warm, poke holes all over the top with a skewer or fork if desired, then slowly pour the warm caramel glaze evenly over the cake. Allow the glaze to soak in for 15 to 20 minutes before serving.