At the time when Machiavelli wrote The Prince most Italian states relied on mercenaries for their defense. Machiavelli's own Republic of Florence was one such state, much to Machiavelli's frustration. The political leaders of the city believed that establishing a standing army was a potential threat to liberty and could be used as an instrument of oppression by would-be tyrants. Less nobly, they believed that a standing army would be too expensive to maintain.
Machiavelli thought this a dangerously short-sighted attitude. He argued instead that a standing army was essential to the long-term stability of the state. An over-reliance on mercenaries had severely weakened Florence and other states, making the whole Italian peninsula vulnerable to foreign invasion and interference, especially from the French.
Machiavelli is insistent that a prince, in order to be an effective ruler, must always be able to command his own native troops. Otherwise, his principality would never be secure. As mercenaries and auxiliaries would never owe their loyalty directly to the prince, they would therefore prove unreliable as props to his power.
For Machiavelli, an understanding of the art of war is essential to statecraft. Without it, there is no state to speak of. And if the art of war is to be successfully practiced it must be based on the maintenance of a large, well-armed standing army that owes its loyalty directly to the prince and which can be counted on to defend him from his many enemies, both domestic and foreign.