This might not be the first time you've seen a layer cake filled with candy. The "pinata cake," as some people call it, has been showing up on blogs and Pinterest boards in all sorts of forms. To create our version, a Pot of Gold Cake for St. Patrick's Day, we spent weeks perfecting the recipe so the layers were moist but still structurally sound.
Make the cake: Preheat the oven to 350 degrees F. Coat two 8-inch round cake pans with cooking spray; line the bottoms with parchment paper. Coat the parchment with cooking spray and dust the bottom and side of each pan with flour, tapping out the excess. Whisk the flour, baking powder and salt in a medium bowl; set aside.
Beat the butter and sugar in a large bowl with a mixer on medium speed until light and fluffy, 3 to 5 minutes. Reduce the speed to low; add the egg yolks one at a time, making sure each is incorporated before adding the next. Beat in the vanilla. Beat in the flour mixture in 3 batches, alternating with the milk in 2 batches, until just incorporated. (It's OK if the batter looks curdled.) Increase the speed to medium and beat 1 more minute.
Divide the batter between the prepared pans and spread evenly. Bake, rotating the pans halfway through, until the tops are golden and spring back when lightly pressed, about 40 minutes. Let cool 15 minutes in the pans, then run a knife around the sides of the pans to loosen. Turn out onto a rack to cool completely; discard the parchment.
Make the frosting: Bring a few inches of water to a simmer in a medium saucepan over medium heat. Whisk the egg whites, sugar and golden syrup in the bowl of a stand mixer. Set the bowl over the saucepan; cook, whisking, until the sugar dissolves, the egg whites become frothy and the mixture is warm, about 5 minutes. Transfer the bowl to the stand mixer and beat with the whisk attachment on medium-high speed until stiff glossy peaks form. Switch to the paddle attachment. Beat in the vanilla, then beat in the butter a few pieces at a time until smooth. (It's OK if the frosting looks separated; keep beating.)
Cut a 3 1/2-inch hole from the center of one cake layer with a paring knife; set the cake layer and the cutout aside. Score a 3 1/2-inch circle in the center of the other cake layer, then scoop out the middle without going all the way to the bottom; carefully transfer the cake to a serving plate. Spread the top of the scooped-out cake (but not inside the hole) with 1 cup frosting. Top with the other cake layer and pour the M&M's into the hole. Slicing horizontally, cut off the top 1/2 inch from the reserved cutout to make a thin round; place on top of the candies to form a lid.
Frost the top and sides of the cake with the remaining frosting. Refrigerate until just firm, about 20 minutes. Dip a small dry brush in luster dust; tap and brush all over the cake.