The answer to this question can be found in Chapter XVII of The Prince. Here Machiavelli observes that, given a choice, rulers would obviously want to be loved and feared. But if this is impossible, he argues, and if a ruler had to choose between one or the other, it is better to be feared than loved. The reason for this lies in Machiavelli's cynical view of human nature:
For of men it may generally be affirmed that they are thankless, fickle, false, studious to avoid danger, greedy of gain, devoted to you while you are able to confer benefits upon them, and ready, as I said before, while danger is distant, to shed their blood, and sacrifice their property, their lives, and their children for you; but in the hour of need they turn against you.
In other words, the love of the people is not terribly reliable, and is rarely sincere. Professions of love made to a ruler's face are "broken on every whisper of private interest," while fear is unconditional and sincere. Machiavelli goes on to stipulate that while it is important to be feared, a ruler does not want to be hated. In particular, while he sometimes might have to be cruel, he should abstain from taking the property of his people, which is an unforgiveable offense. Ultimately, Machiavelli concludes, one can be feared through one's own actions. Whether or not one is loved depends on his subjects. A ruler should always try to control only those things he can, though he ought to always be on guard against being hated.