Solubility
The job of the kidneys is to process the blood and filter out waste products and excess minerals from the blood. These excess minerals are concentrated to form urine, which is primarily made up of water. When minerals and other compounds are dissolved in a solvent such as water, there's a limit as to how concentrated these dissolved substances can become. If they become too concentrated in the urine (because the kidney has removed too much water from the urine) they begin to come out of solution and form a solid. These newly undissolved minerals can form hard stones in the kidneys.
Types of Stones
As the Mayo Clinic explains, most kidney stones are formed by elevated levels of calcium in the blood. When the kidney attempts to remove this calcium from the blood, it can combine with another mineral (called oxalate) to form calcium oxalate kidney stones. Sometimes kidney stones are formed out of other materials. For example, when the urinary tract develops a bacterial infection, the bacteria can cause the buildup of a mineral called struvite, which can form rapidly growing stones. Uric acid stones can be formed by being dehydrated and by eating a diet that's high in protein. Finally, some stones are made out of cystine--which is caused by a genetic disorder that causes the kidneys to secrete too much cystine, an amino acid.
Stone Passing
Kidney stones can vary greatly in size. As the National Institute of Diabetes and Digestive and Kidney Diseases explains, kidney stones can be as large as a golf ball or as small as a grain of sand. Smaller kidney stones typically pass on their own. Kidney stones generally cause pain when they get trapped in the urinary tract--particularly when they get into the ureter, a tube that carries urine from the kidneys to the bladder. In order to help pass a kidney stone, patients may be told to drink two to three quarts of water to help flush out the urinary system and to generate enough urine to dissolve the stone. Otherwise, stones gradually are pushed by the flow of urine through the urinary system until they're excreted via the urethra. Large stones can be broken into smaller pieces using ultrasound if they're stuck.


