For dogs, cancer is the headline, but the honest answer is that it depends enormously on the breed you chose.
A study comparing US, Finnish, and UK breed data found cancer deaths ranging from 4 percent in Miniature Pinschers to 55 percent in Bernese Mountain Dogs.[3] That spread is the difference between cancer being a footnote and cancer being the most likely way your dog dies.
The pattern behind it is size. Larger breeds carry a much higher cancer risk than small ones.[3] More cells dividing over a lifetime means more chances for something to go wrong.
So when people say "cancer is the leading cause of death in dogs," that's true on average and close to meaningless for your specific dog. A Bernese and a Miniature Pinscher are living different statistical lives.
Age changes the answer completely. The largest study of its kind pulled 74,556 dog deaths from the Veterinary Medical Database across twenty years.[4] Young dogs died disproportionately of gastrointestinal and infectious causes. Older dogs died of neurologic and cancer-related causes. The risk of dying from cardiovascular, endocrine, and urogenital disease climbed steadily with age.[4]
Size shifted it again, and not only through cancer. Larger breeds died more often of musculoskeletal and gastrointestinal causes, while smaller breeds died more often of endocrine disease.[4] The bloat risk that owners of deep-chested dogs get warned about lives inside that gastrointestinal number.