This cake is comfort food at its finest—warm apples, rich spices, and that buttery brown sugar icing that melts in your mouth.
Preheat oven to 325°F. Grease a 9x13-inch baking dish.
In a medium bowl, whisk together 2 cups flour, 1 1/2 teaspoons baking soda, 3/4 teaspoon salt, and 2 teaspoons cinnamon.
in a large bowl, mix 3/4 cup of oil, 1 1/2 cups sugar, 3 eggs, and 2 teaspoons of vanilla until smooth.
Stir in the dry ingredients just until combined.
Fold in 3 cups peeled and chopped apples and 1/2 cup walnuts if using.
Pour batter into the pan and bake for 40–45 minutes, or until a toothpick comes out clean.
Prepare the frosting as the cake cools.
Mix all ingredients except icing sugar in a small saucepan. Let it come to a boil for 2 minutes.
Remove from the heat and add icing sugar to thicken. Stir vigorously to get rid of lumps. Spread on warm cake.
Eat within 3 days at room temperature or store covered in the fridge for up to 1 week.