When the King of France, Louis XII was threatening to retake Milan from the Swiss, Machiavelli was asked by his friend what advice would he give to the Pope at the time. Should he side with the French, the Swiss or stay neutral? Machiavelli answered that he should support the French.
In his view, staying neutral when two others are fighting would lead to defeat for the neutral party, as they have left themselves in a position to be hated by both sides.
If one side has performed favours for the uncommitted party or they are old friends (as Louis XII was with Pope Alexander VI), then they may feel that they are obliged to side with them and failure to do so could result in hatred. The other side will also feel contempt for the neutral party as they will be seen as timid, indecisive and not an enemy to be feared.
As he explains in The Prince, by not throwing your hat in the ring and declaring which side you’re on, you will be at the mercy of the conqueror and will also earn the scorn of the loser:
A prince is also much respected but he is either a true friend or a downright enemy. In other words, when he declares himself without any reservation in favour of one party against the other. This will always be more favourable than remaining neutral.
It’s fair to say that Machiavelli was not a fan of neutrality as a policy as it often leads to weakness. He identifies indecision as a destructive vice in a leader. There is an obvious risk associated with picking a side, but to not pick a side is indecisive, unforgivable and eventually fatal in his eyes. Action is often preferable to inaction, even if it leads to eventual defeat.