Parshas Ki Tisa begins with the instructions of how to conduct a census of the Jewish people. Hashem instructs Moshe not to count the Children of Israel directly, but rather to collect a half-shekel contribution from each individual, thereby allowing a census to be taken by tallying the coins collected. The Torah provides that by following the proper census procedure, a plague will not be visited upon the nation. Indeed, in the days of King David, this procedure was not followed, with tragic results. Therefore, everyone from the age of twenty must contribute a coin, and the coins will be counted.
The connection between counting the individual members of the Jewish people directly and the outbreak of a plague seems enigmatic. Why is a plague the consequence of not heeding the appropriate census methodology?