Prep your pans and oven: Heat the oven to 350°F (175°C). Grease and line two 8-inch round cake pans with parchment, or use a 9x13-inch pan.
Lightly flour the sides.
Whisk the dry ingredients: In a medium bowl, combine flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger. Set aside.
Mix the wet ingredients: In a large bowl, whisk eggs, granulated sugar, and brown sugar until smooth. Add oil, buttermilk (or yogurt), and vanilla.
Whisk until combined.
Combine wet and dry: Add the dry mixture to the wet bowl. Stir gently with a spatula until just combined. Do not overmix.
Fold in carrots and mix-ins: Stir in the grated carrots.
If using, add nuts and raisins. The batter will be thick—that’s good.
Bake: Divide batter between the two round pans (or pour into the 9x13). Smooth the tops.
Bake 25–30 minutes for rounds or 35–40 minutes for a 9x13, until a toothpick comes out clean with a few moist crumbs.
Cool completely: Let cakes cool in the pan for 10 minutes, then turn out onto a rack. Peel off parchment and cool fully before frosting.
Make the frosting: Beat cream cheese and butter until fluffy, 2–3 minutes. Add powdered sugar gradually, then vanilla, salt, and lemon juice if using.
Beat until smooth and spreadable.
Assemble: For layers, place one cake on a plate, spread a thick layer of frosting, top with the second cake, and frost the top and sides. For a 9x13, spread frosting over the cooled surface.
Finish and set: Chill for 20–30 minutes to help the frosting set. Slice and serve.