If you know or don’t know the right thing to do, and do the wrong thing, God will judge you. In the case of the Gentiles, all they knew (or sensed) about God was that he was the creator (Romans 1:19), but they wantonly sinned. This truth (about the Creator) was enough to set them on the straight path but they ignored it.
The Jews, on the other hand, had their past miraculous deliverances and the law, but sinned anyway. They even had the audacity to judge those who didn’t really know any better. So they too are judged.
We should know that God doesn’t play favorites. When we sin in any fashion, that is to act in a selfishly ambitious manner to satisfy our own wants (Romans 2:8), many times in secret (Romans 2:16), we’re really pushing it. We’re storing up God’s wrath!
Those who persevere on the eternal path are focused on humbly doing good. They’re obedient to the truth and know, but for the grace of God, there go I!
For all have sinned and fall short of the glory of God, being justified as a gift by His grace through the redemption which is in Christ Jesus. (Romans 3:23-24)