In the context of hemodialysis, the dialysate solution flows outside the semi-permeable membrane of the dialysis machine. Blood flows on the other side of this membrane, allowing waste products and excess electrolytes to diffuse from the blood into the dialysate. In peritoneal dialysis, the dialysate is introduced into the peritoneal cavity, where it absorbs waste products and excess fluids from the blood vessels in the peritoneal membrane.