Personally I think this is one of the more interesting questions I have been asked. The answer lies in adaptation. The ability of a species to adapt to changing circumstances. If it can alter its diet, or survive change and adapt to it, it may continue. If not, it likely went extinct.
In a previous article I discussed why plesiosaurs died off yet not crocodile or alligator ancestors which appeared about 83 million years ago. We have also discovered ancient fish such as coelacanths, thought to have gone extinct 66 million years ago and we have horseshoe crabs which have been around about 300 million years, – since before the dinosaurs.
As for those species that went extinct – many died off because their food source disappeared entirely or their place of habitation changed dramatically due to factors such as rapid climatic change.
There are multiple reasons for this having occurred. The supercontinent Pangea broke up and drifted upon earths plates into new and different positions becoming today’s continents.
Some lush areas became deserts, such as the Sahara. In some cases mountains pushed up blocking clouds from delivering rainfall. Antarctica drifted southward becoming encased in ice.
Severe extended climatic winters developed from reduced sunlight hitting earths surface.
More than once this was caused from ejecta in our upper atmosphere created from both the impact of asteroids, and from volcanic eruptions such as the Deccan traps in modern India that happened a little over 66 million years ago.
Read about it in this 2014 article here.
Predators seeking plant eating animals lost their food source because the plant eaters they ate lost their food source.
Species that could adapt and find food they could eat- such as carrion- decaying bodies of formerly living creatures- remained. That would account for crocodilians, and other species.
The early mammals that survived this period were all relatively small burrowing animals that adapted.
Our ape ancestors diverged from other ape species about 6 plus million years ago, long afterward.
We don’t really know the catalyst that caused those early hominins to diverge, but we know that areas filled with trees eventually gave way to become savannah. Conditions imparted a necessity of change to survive. Those that did carried on their species. Those that did not, died out, just as did millions of other species.
Just as we can trace back our human origins back millions of years, so can we trace back the ancestors of other ape species alive today.
The ones that are here are the product of millions of years of evolving to survive circumstances that put them at risk.
Monkeys are not apes, but we can trace them back as well. They too have evolved. African monkeys do not have grasping (prehensile) tails as do South American (new world) monkeys. There are many other differences
Read about that here.
Why? Because features to survive need to adapt for a species survival needs if the time to evolve permits.
Sudden change can cut survivability.