Contamination comes from 4 main sources.
The number one source is dirty maintenance parts such as the cap top and wiper but also just ink build up on the bottom of the head. Clean everything really well and make sure there are no inkcicles forming on the bottom of the head. +
The second most common reason is the cap top is not draining fast enough. Fill the cap top with cleaning solution and wait for about a minute. The solution should naturally start to flow down the tubes. If it just stays in the cap without draining, you have partially or fully clogged pump tubes. You can usually unclog them by flushing solution through with a syringe. When the cap top doesn't drain fast enough the colors get sucked up into the head when it caps.
The third most common is failing dampers. If one damper is failing, it causes the other side to start pulling back on the system. This pulls ink up from the waste tubes and cap and gets sucked into the head. Replacing the dampers should be a yearly maintenance item so if they are older than a year you might a well change them all out. Having one strong damper and one weak will cause this issue so it's always good practice to change either all 8 at a time or at least 2 dampers per color.
The fourth and least common, but not as rare as you think, is the head is damaged internally and is unrecoverable. This happens on older heads and heads that have been flushed manually with a syringe too hard. A membrane inside the head separates the channels. If it breaks, you get contamination that is only fixable by replacing the head.