When you think of violence, you probably think of wars and fights and sad stuff. Okay, yeah, that happens. But in The Prince, violence is a handy-dandy thing. You can use it to stop other violence from happening, to get safety, honor, fulfillment, and all kinds of treats. Sure, it might be mean and immoral, but isn't the theme of this book that you don't need morals to be great at politics? If you're looking for a non-violent manifesto… keep looking.
For Machiavelli, cruelty has nothing to do with morality. What matters is whether it is used rightly or wrongly.
Being in personal danger doesn't excuse the violence of the rulers in The Prince. Morality and humaneness trump efficiency.