I can give you a few reasons why and one of them is that it depends on the manufacturer. The old saying cheap gun, cheaper barrel comes to mind.
Some cheap guns use more metal and less process. It's easier to make the barrel heavier with cheaper metal than to use better more expensive metal that has to go through different heat treating or tempering processes that cost more money. Simply put, to save money.
Another reason for a thinner barrel might be exampled by the Taurus 780tcp.
It's made from strong stainless but shoots a 380 round and they simply made the barrel thick enough to handle the pressure and nothing more.
A reason for a thick barrel of high quality like a high quality stainless barrel found in many hand guns like the M&P, Ruger SR9, and the Glock 19 is a different story and implies one or more reasons and that's where it gets tricky for me. The +P and +P+ capabilities come to mind. Also that it wears so very little. Another is that they mostly are designed with the metal jacketed bullet in mind which would wear out a softer barrel much quicker.
Another that comes to mind, and I have no answer too it,other than just the aforementioned jacketed bullet is that they just beef it up beyond the necessity. They make some guns that are not +P or +P+ rated even though the barrels can handle well the normal powder charge. Much thicker than needed, but I am ok with that!