Cancer cells can spread to the peritoneum through several mechanisms. One common route is the shedding of cancer cells from the primary tumor into the abdominal cavity, where they implant and grow. Another mechanism is through the lymphatic or blood system, which allows cancer cells to travel and colonize distant sites, including the peritoneum.