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.