When it doubt, go back to the source….
The Free Cities rely on mercenaries for the same reason that the city-states of Renaissance Italy did. Standing armies are seriously damn expensive: while it’s something of a chicken and egg scenario, it took the emergence of the nation-state with its formidable bureaucracy to pay for the armies of the early modern period, and even then there were a lot of bankruptcies in the process before they got it right.

If you’re a businesslike commercial republic, it doesn’t make any sense to absorb the immense costs of a standing army and the concomitant waste during periods of peace, when you can just rent a mercenary army for however long the war lasts. (And you thought the gig economy was new!)