By far the commonest type of renal calculus ("kidney stone") is a calcium oxalate stone. Calcium (Ca2+) is of course a positively charged 'metal' ion in solution, and it readily binds to oxalate, a substance usually obtained from the diet, that - conveniently - has two negative charges on its ion. Under the right conditions, the two go together like hand in glove, forming a precipitate that can enlarge as the process repeats itself and new calcium oxalate comes out of solution.
What are these right conditions, though? Well, dehydration certainly helps. We all know that you can dissolve two teaspoons of sugar into a full cup of tea without a problem, but this is quite a lot more challenging with only a quarter cup. Ultimately, there has to be enough stuff to dissolve the salt, and this is a problem with dehydration.
On the other hand, you may just be ending up with too much calcium and oxalate salt in the kidneys despite adequate hydration. This would be the equivalent of trying to dissolve a whole bag of sugar in your tea. For instance, many people simply have idiopathic hypercalciuria, a condition in which (for no apparent reason) they just excrete too much calcium into the urine. In addition, hyperparathyroidism can also cause a generalised increase in serum calcium levels, which is reflected in an increased amount of calcium in the urine too. Furthermore, a high sodium diet may also result in hypercalciuria.
And so on. Either way, there must be increased amounts of calcium oxalate in the urine, or else there must be decreased fluid in the urine. This is the recipe for stone formation.
Incidentally, it might be thought that a treatment for calcium oxalate stones would be to limit dietary calcium intake. Although on the face of it this makes intuitive sense, such action seems to have quite the opposite result: restricting calcium intake may result in more calcium oxalate stones. Why? Well, calcium is quite happy to bind to oxalate in the gut too, and doing so prevents either from being absorbed into the body in the first place. Decreasing your dietary calcium paradoxically means that more oxalate will be absorbed, thus threatening to cause the very renal calculi that you are trying to avoid.