Kidney stones consist of minerals and salts. These hard things accumulate inside kidney and form stones. They generally form inside kidney and may travel up to urinary bladder. So they can damage any part of the urinary system if they get stuck there. In most cases, when urine becomes dense, minerals change into crystals and form stones inside kidney.
Having stones in urinary system can be very painful mainly when it is trapped in the urinary tract. Otherwise the patients are advised to drink huge amount of water so that stones could easily be moved from urinary system. In case the stone is trapped in urinary tract it may cause infection or carry other various health complications. In this scenario, doctors may suggest surgery to remove stones from urinary tract.
Source: https://www.mayoclinic.org/diseases-conditions/kidney-stones/symptoms-causes/syc-20355755