The slide catch on most guns is spring loaded so that it remains in the the disengaged position. A piece of the mag presses the catch up, with more force than the spring on the slide catch. In my Beretta, it is the piece the the botton bullet rests on. When a full mag, or one with only on bullet, that devise in the mag, or on it, is no longer holding the slide catch. The friction from the slide pressing against the catch, is what prevents the catch from moving down, and the slide closing. When you slam a mag in, the vibration causes the slide to move back, or at least removes some tention, and the slide catch spring is able to push the catch down, and the slide closes.
I have a Beretta 96 that does it if you really slam the mag in. I have to slam it in pretty hard to get it to do that. I also have a Ruger Mk 2 Target pistol, and the mag has a button on the outside that pushes the slide catch up.
Hope that made sense, physics is a hobby of mine.
If the slide is releasing with too light of an impact, a stonger recoil spring could solve the problem, but may cause others... I think it is a QC issue. Thats a tight tolerence to try to hold, and the problem could be that the mating pieces of metal are too slick.... Take the gun to a gunsmith and ask him if he can do anything. Good luck, and just remember to first rule of gun safty, always keep it pointed in a safe dirrection. Stay safe.
P.S. I thing this is what New_Comer and Satyan119 were geting at.