The urogenital system develops from urogenital ridges of the intermediate MESODERM. First stage is pronephros. Next is mesonephros, in which primitive nephrons form and produce some urine (as early as 9 weeks gestation) which goes into the gut tube (cloaca) of the pre-human. The MESONEPHRIC DUCT becomes the ductus deferens. The metanephros is the final form of the kidney. It forms when the URETERIC BUD (aka metanephric diverticulum) branches out from the mesonephric duct and forms the collecting system (ureter, calyces, collecting tubules). It signals the surrounding mesenchyme to become the metanephric blastema, which blasts out the rest of the kidney including the rental tubules. Vascular cells migrate into the blastema and form glomeruli.
( a little bit more including strange kidneys )