Begin by preheating your oven to 350 degrees F. Line two cupcake pans (24 cupcakes total) with paper liners and set them set aside.
In a large bowl, whisk together the flour, baking powder, and salt. Set aside.
With an electric mixer, cream together the butter, sugar, and vanilla at medium speed until light and fluffy (5-6 minutes).
Add the eggs to your sugar mixture, one at a time, and blend well after each addition. Scrape down the sides of the bowl as needed.
With the eggs incorporated, add the dry ingredients. Alternate with your milk, beginning and ending with the dry ingredients. Mix until just combined.
Divide the batter into the prepared cupcake pans, filling each cupcake liner about three-quarters full.
Bake for 16-20 minutes or until the cupcake springs back when pressed in the center. Allow the cupcakes to cool in the pan on a wire rack for about 10 minutes. Then remove the cupcakes from the pan and place them on a wire rack to cool completely.
While your cupcakes cool, prepare the frosting.
In the bowl of a stand mixer, with the paddle attachment, beat the butter on medium speed until it becomes pale and fluffy.
Adjust the mixer to low speed and add the powdered sugar, one cup at a time, until it is incorporated. Increase the mixer speed to medium and add the vanilla extract, salt, 2 tablespoons of milk, and food coloring. Add more milk, 1 tablespoon at a time, to achieve the desired constancy.
Add the frosting to a piping bag fitted with a large open-star tip.
To add the M&Ms to the cupcakes: Use a small paring knife to cut a circle in the top of each cupcake. Gently remove the section of cut cupcake and reserve.
Using a teaspoon, create a small cavity in the cupcake. Fill with 5 or 6 M&Ms. Then replace the reserved cake circle to seal in the M&Ms. Pipe each cupcake with buttercream frosting and top with sprinkles.