But do nuts also help people avoid other diseases, like cancer and diabetes? An international group of researchers, publishing in the journal BMC Medicine, analyzed 29 studies about nuts and health outcomes to find out. In their review, which included data on more than 800,000 people, they found dramatic body-wide benefits for eating nuts.

People who ate about about a handful (20g) of any type of nuts—tree nuts, like hazelnuts, walnuts, pecans and almonds, and peanuts, which are legumes—a day had nearly 30% lower heart disease rates compared to people who didn’t eat nuts, a conclusion previous data supported. But they also had a 15% lower risk of cancer and a 22% lower risk of dying prematurely of any cause. People who ate nuts regularly also cut their risk of dying from respiratory illnesses by nearly half, and they reduced their risk of diabetes by nearly 40%.

The results remained consistent across the wide range of populations in different geographical areas that were included. Men and women both saw benefits, and the type of nuts consumed also didn’t seem to make much difference; nut-eaters of all kinds consistently showed lower rates of many major diseases.

Nuts may be having these effects through their abundance of fiber, nutrients and antioxidants; while they are high in calories and fat, they contain mostly healthier fats, which can lower risk of heart disease. Their high fiber and protein content may also help reduce extra weight gain by curbing overeating. They’re also packed with antioxidants, which can fight the damage to cells that can trigger cancer.

The findings support the notion that nuts are a worthy addition to the diet, but the benefits had a threshold, however. People eating more than 20 daily grams of nuts didn’t seem to show additional reduction in their risk of developing conditions like heart disease or cancer or the other health outcomes—so as with everything in nutrition, nuts are best in moderation.