It's a combination of your body chemistry and what you eat, and sometimes whether you have sufficient water intake. Some people seem to have them forming endlessly. If you are fat you will be more likely to have them, but not so much bacause you are fat as the stuff you have eaten combined with other lifestyle choices you have made that got you fat can also get you kidney stones.
BigV is right, it is a pain like no other this side of Iraqi tortures. It feels like a knife stuck in your back, the pain does not subside no matter what you do. Unfortunately, you just have to wait for the particle to make it all the way down