The difference is the M16A1 flash suppressor. (It's not a compensator.) And that difference is cosmetic.
That said, I had my earlier M&P15-22 barrel threaded and screwed on a real M16A1 flash suppressor. Just feels better.
Not sure why I took this photo but both types show:
M16A2 compensator (no bottom shots) top
M&P15-22 with M16A1 flash suppressor (slots all around) bottom
-- Chuck