Since we have no idea what the OP values, we have no basis to provide a definitive recommendation.
Here's a crude rundown. I have shot both.
Ergonomics: VP9. Panels and backstraps offer a more custom feel than the palmswell alone. You can mix and match side panels.
Mag capacity: Even in 2020 with the VP9 upgrade.
Magazine quality: Even. VP9 has rubber baseplates. M&P has aftermarket support of springs/baseplates. VP9 has more holes to indicate the ammo level on the back. M&P has strategic holes on the side. Po-tay-toh/Po-tah-toh
Magazine cost: M&P. $45-49 retail for the VP9 per mag and they are rarely on sale. Two best times to pick up mags were Black Friday 2019 when HK sold 4ea 15rd'ers for $100 to make way for the 17rd mag introduction and the buy the gun, get four mags free promotion. They are memorable because they are rare. M&P mags can often be purchased for $30-35, less on sale/clearance/used/police trade in.
Trigger out of the box: VP9. It does not need any modification. Smooth take up, hit the wall, click. M&P is good and Apex is available.
Sights: M&P. While there is no immediate need to change the sights on either as both are quality and metal, there are way more options and manufacturers supporting M&P sights. Tritium, fiber optic, "claw" rears, blackout, straight eight - you name it, someone makes it for the M&P. VP9 has some support, but slimmer pickings and the factory VP9 sights use the "drive the dot" hold out to about 25yds.
Finish: Even. M&P is slightly more gloss and VP9 is more matte, but nitriding or nitrocarburizing is a great finish, no matter the trade name.
Areas for nitpicking:
Rifling: lands and grooves vs polygonal
Tactical polymer slide ears
Steel frame support and how much you buy into that making a difference
Forward slide serrations
Mag release: reversible button vs ambi lever vs VP-9B versions
Available longslide upgrade for VP9
Goldilocks grip texture opinions
No fingergrooves vs slight fingergrooves
Holsters. In our day and age, an incredible amount of manufacturers can mold kydex or sew leather to any configuration.
Warranties offered on two of the most reliable handguns that will fire 10x or more of their purchase price in ammo.