Milwaukee is actually the economic engine of the state, Madison is the education/governmental engine of the state.
As for why it's so liberal the Republican party's platform right now is to shrink the government drastically, destroy the universities while cutting their budgets to skeletons and tell everyone who works in those industries that they're evil, un-American mongrels and it's not hard to see why they're so liberal.
Epic Systems, Exact Sciences, and Spectrum Brands would like to have a word with you about economic engines.
Milwaukee is a bunch of middling manufacturing outfits whose best days are behind them (Harley Davidson, Johnson Controls, etc).
Northwestern Mutual, Johnson Controls, Fiserv, Manpower, Rockwell, Kohls, so basically 6 fortune 500 companies and many, many more.
Madison is a very strong economy but it is NOT the economic engine of the state. It's also a bubble with many people in Madison having no idea about Milwaukee at all and never going there, while people here love to go to the capital.
Edit: As a side note Epic basically treats new hires as trash, they're basically a meat grinder for new tech grads. Very long work, not good pay/benefits, they eat them up and spit almost all out.
I was considering applying to Epic during a career fair but didn't want to relocate to Wisconsin. Had no idea they treat their employees like Amazon does.