The World Governance Indices (WGI) are based on surveys done by a variety of governmental organisations and NGOs. As such they reflect the perception of corruption that people (citizens, entrepreneurs, academics) have. There are lots of such surveys. And they essentially consist of simply asking people "Have you experienced corruption of government officials?" or "Have you paid a bribe in the last 12 months."
There are advantages and disadvantages to the survey method of measuring corruption, for example, beliefs, biases and stereotypes can feed into the results, and then become treated as "fact". On the other hand, measuring the perception of corruption can provide data when the actual objective values are impossible to obtain. It's not possible to find out from official sources, how much money was corruptly diverted since corruption is not legal. Often "perception of crime" correlates better with the actual effect of crime, than official figures on the number of people convicted.
So the reason that Bangladesh gets a lower score for corruption than India is because that is how people who deal with Bangladesh and India describe the two countries. People with dealings in South Asia say that Bangladesh is worse than India or Pakistan.
The function of the World Bank is to aggregate these data from multiple sources. There are about 14 different sources that feed into the calculation of a countries corruption index.
See https://www.worldbank.org/en/publication/worldwide-governance-indicators/documentation#1