Such organizations literally calculate those 'indexes' on ! perceptions !. They ask the people if they think their country is 'corrupt', and people respond yes or no.
https://www.transparency.org/en/cpi/2021
Leaving aside just by selecting the 'right' sample you can make anything happen, there is a bigger elephant in the room: Cultural differences.
In countries like France, Russia and Eastern Europe, complaining is a national sport. People socialize by complaining about everything, foremost, the government, the bureaucracy and so on. So if you ask even a neutral observer, he or she will literally spam many complaints and will strongly state that everything is corrupt.
Conversely, the cultural paradigm in other countries is way too different - in the US, for example, the existence of lobbying and the immense, mind-boggling money in politics are not seen in the same way. They are seen as 'problems', but they are not the game-breakers that should launch the US to the top of the index. They are merely labeled as 'flaws'.
> the Nordic countries rank fairly well as being uncorrupt
Its true that these countries do better in objective criteria related to what we describe as corruption. But their presence in any index does not validate that index. To start with, neither the Nordic citizens see the immense revolving doors and cooperation in between their defense industries, their governments and how their defense industries do business with repressive regimes and all that goes around it as 'corruption'. Many are not even aware of its existence.
And the elephant is in the room for them too - Nordic countries have a cultural propensity to stoicism, and they also say that they are happy in polls for happiness indexes, and they rank high in them. And yet their suicide rates are far higher than the countries in which people say they are unhappy, but live longer and healthier (like Spain etc).
So these indexes are just PR and propaganda vessels that pitch the world view of their establishment and their society's culture.