How Dialysis works as Kidney Treatment

How does the process of Dialysis work to resolve kidney problems? Please explain comprehensively how the process works and do cite medical references when possible.