There's an entire field that studies exactly this question: public choice theory.
https://en.wikipedia.org/wiki/Public_choice