Garlic contains sulfur-containing compounds like allicin, diallyl sulfide, and diallyl disulfide, which are thought to have anti-cancer properties. These compounds can help in the prevention of cancer by enhancing DNA repair, slowing the growth of cancer cells, and inducing apoptosis (programmed cell death). Studies have shown that garlic may reduce the risk of developing certain types of cancer, particularly gastrointestinal cancers such as stomach and colorectal cancer.