Preheat oven to 350°F. Coat 2 (9-inch) round cake pans with cooking spray; dust with flour.
Beat sugar and butter with a stand mixer fitted with a paddle attachment on medium-high speed until fluffy, about 4 minutes. Add eggs 1 at a time, beating well after each addition.
Stir together flour, baking powder, and salt in a bowl until combined. Add to butter mixture alternately with milk in 2 batches, beginning and ending with flour mixture, beating on low speed until incorporated after each addition. Stir in vanilla.
Pour batter evenly into prepared cake pans. Bake in preheated oven until a wooden pick inserted in centers comes out clean, 25 to 28 minutes. Cool in pans 10 minutes. Remove layers from pans, and let cool completely on a wire rack, about 30 minutes.
