if a pearsons kidneys fail why is he or she hooked up to dialysis machine

the kidney is failing to filter out the toxins in the blood

The best first place to try on general questions like this is google.
You will find many examples, illustrations, discussions, and videos.