The ratings don't include many of the crash-test results
Oftentimes, a car's safety rating doesn't give you the full picture of its crash-test results. The greatest importance is placed on the safety of the dummy in the driver's seat, since the majority of serious injuries or deaths occur to drivers, but as a result, the ratings neglect to take into account what's happening in other parts of the vehicle.
Take, for example, the 2017 Hyundai Accent. Four stars for frontal collisions, four for side impact, and four for rollover. I pulled up the actual test data for the car, though, and the numbers tell a different story entirely for anyone in the rear seat. In three of the five areas measured, the dummy in the back would have sustained injuries after being struck by the left rear door, resulting in "high lower spine acceleration" and a higher chance of thoracic injury. There was also a high "abdominal rib deflection" that the NCAP expressly states was not included in the star rating.