The buffer is the piece that fits in the stock. It it a piece of weight, between 2.7 and 5 ounces. (Depending on the model). It sits against the buffer spring which is in the stock. The weight of the buffer provides additional RESISTANCE so that when the bolt recoils back after a shot, you have proper resistance. With just a spring, the recoil would be too harsh, and the bolt would get beat up slamming back so hard. If the buffer has too much resistance (Too heavy), then the bolt isn't allowed to go back far enough. Then you get what is called short stroking. That's when the bolt doesn't go back far enough to eject the old case or far enough to grab the new round. Or far enough back to lock open on the last round.
You would love to have the perfect weight for your gun, because that would be the ultimate resistance on the bolt. Unfortunately, no 2 rounds of ammo, let alone brands, weights, etc... of ammo are the same. So, you go for an average. That's why there are many different weight buffers. Carbine, "H", "ST-T2", "H2", and "H3".
M&P15 are generally OVERGASSED. Meaning, they have more gas pushing the bolt back than normally expected. The reason for this, is because MIL-SPEC AR's would be using 5.56 ammo. However; most people use .223 ammo because it's cheaper. But .223 ammo creates LESS GAS PRESSURE. So, by having the M&P15 "Overgassed" it make it work with just about any and all ammo. If you shoot higher pressure ammo, it sometimes sounds rougher. Almost like it's being beat up. So, some people change out the buffer. Some go to the "H" buffer which is the norm for most AR's. Some go with the ST-T2 because it's smoother. Some go heavier because they always shoot hotter ammo.
Swapping out the buffer takes about 37 seconds. LITERALLY!!! Push the pin that opens up your AR so you can see the bolt and charging handle. On the STOCK side, you'll see a round metal that is spring loaded. This is the buffer. It's what the bolt carrier group pushes again. At the bottom of the buffer, you'll see a push pin. Push the pin down, and the buffer will spring out. When you put the new one in, push the pin down as you're putting in the spring and the buffer. good luck.