Mayonnaise replaces the fat (butter or oil) in these otherwise traditional cupcakes, yielding a richly flavored yet light-in-texture cake with a smooth, creamy ganache-like frosting.
Preheat oven to 350 degrees. In a large bowl, whisk together flour, cocoa, sugar, baking powder, and salt. Whisk in eggs, coffee, vanilla, and mayonnaise until smooth.
Divide batter among muffin cups fitted with paper liners (about three-quarters full). Bake until tops spring back when lightly pressed, 15 to 17 minutes. Let cool completely in tins; remove.
Whisk together mayonnaise and cocoa. Whisk in confectioners' sugar and milk until smooth. Divide evenly among cupcakes.