A little bit more research, it seems that you are referring to indexes like Tue "Corruption Perceptions Index" by Transparency International. Looking into that one in particular, they seem to use data from all sorts of institutions, standardised for a 0-100 scale. No country has a perfect score of 100, meaning all nations are corrupt to some degree according to this index.
Some reading of the documents outlining their results and methodology (wow, Transparency International is pretty transparent!) show that they only use data when there they come from multiple sources, omitting one-offs. They also add a measure of uncertainty, since sources will differ for each nation.

Looking at their map, you can see a general idea of the levels of corruption across the world. This index highlights that countries that are more corrupt generally have fewer freedoms and are more authoritarian. When there are fewer checks in place, those in power tend to be more corrupt. Areas with a lot of conflict, such as Somalia (9) and Syria (15), tend to have more corruption as well.
In 2025, they note that many democracies around the world have worsening corruption, like the United States (64), the UK (70), France (66), New Zealand (81), Sweden (80), etc. In many of these places, it is due to the rollback and weakening of anti corruption legislation.
Many low-scoring countries are slowly improving! They highlight Albania (39), Laos (34), Senegal (46), Ukraine (36), and others for their efforts in reform. They still have ways to to though, with scores below 50.
Additionally, some middle to high scoring countries are also improving, like Estonia (76), South Korea (63), Bhutan (71), Seychelles (68), etc. due to their adoption of stronger justice systems.
The report notes that declines in CPI are mostly due to a combination of the breaking of democratic integrity and independent institutions. Gains in CPI are typically due to greater rights, media freedom, and access to information. They also note that many authoritarian nations have used their control to clamp down on corruption with an iron fist, mentioning that it is effective against bribery, but believe that this approach is not sustainable for all types of corruption, and that they could easily be reversed based on a change in the political environment.
The report also highlights many protests in various nations based around the perceived corruption of political leaders, like in Nepal.
I have sourced this mainly from their published 2025 report on CPI, as well as their basic description of their methodology found on their website.