This is an inaccurate summary. The police set up the incentives so that regardless of what the other player does, you get a shorter sentence if you cooperate with them. For example: If you both keep your mouths shut, you each get one year in prison. if you both confess, you each get two years. If one of you confesses and the other doesn’t, the confessor goes free and the other one gets 4 years. If the other person confesses, confessing yourself gets you 2 years instead of 4. If they don’t, confessing gets you 0 years instead of 1.
This is what we call a strictly dominant strategy, and uncertainty has nothing to do with it. In fact, because each player has a unique strictly dominant strategy, there is no uncertainty at all. So it’s wrong to say “because each doesn’t know what the other will do.” Each one knows exactly what the other will do, and it doesn’t matter.