Prepare the Oven and Pans: Preheat the oven to 350°F. Grease and flour three 9-inch round cake pans, then line the bottoms with parchment paper.
Mix the Dry Ingredients: In a large mixing bowl, combine the flour, granulated sugar, baking soda, cinnamon, and salt.
Add the Wet Ingredients: Add the eggs and vegetable oil. Mix until the batter comes together without overmixing.
Fold in the Carrots: Stir in the finely grated carrots and optional chopped pecans until evenly distributed.
Divide the Batter: Pour the batter evenly into the prepared cake pans and smooth the tops.
Bake the Cake Layers: Bake for approximately 40 minutes, checking for doneness with a toothpick. It should come out without wet batter.
Cool Completely: Let the cakes rest in their pans for about 5 minutes, then remove them carefully and cool completely on wire racks.
Prepare the Frosting: Beat the softened cream cheese and butter until smooth. Add the vanilla extract and gradually mix in the powdered sugar until creamy.
Assemble the Cake: Place one cooled cake layer on a serving plate and spread frosting over it. Repeat with the remaining layers.
Frost and Decorate: Cover the top and sides with the remaining frosting. Sprinkle chopped pecans over the cake if desired.
Slice and Serve: Refrigerate the frosted cake until ready to serve. For the best texture, let each slice sit briefly at room temperature before eating.