Fact is, if someone is counted in the census, they are represented in the state house and in the U.S. House. (Even if they don’t vote.)
So whoever does the census, determines the results of elections. Combine this with sophisticated techniques to determine district lines ...
Actually, whoever runs the state legislatures, determines the results of the elections.