In 1858 during Italian unification, the Prime Minister of Sardinia-Piedmont, Cavour, entered into an alliance with France. In return for French aid against Austria, Cavour ceded Savoy and Nice to France. Why didn't Cavour instead ally with a strong enemy of Austria (like Prussia) that wouldn't demand such concessions? Maybe the unification might have been faster because Prussia would have upheld their bargain...
France was the (potential) ally most immediately at hand. Piedmont had been allied with France (and England) in the Crimean War against Russia, and while England could not provide immediate help, France could.
With the benefit of hindsight, one could see that Prussia would have made a more reliable ally in 1866. But Prussia and Austria were allies as late as 1864, in a war against Denmark. And in fact, the fear in 1858-9 was that Prussia would interfere on the side of Austria.
Ironically, it was an assassination attempt against Napoleon III (by an Italian) that got him interested in helping Piedmont. The assassin claimed to do so, not out of hatred for Napoleon III, but out of love for Italy, and claimed that if Napoleon III helped Italy unite, all the Italians would love, rather than hate him.
Basically, Napoleon III was "willing" (if weak, and treacherous) to help Piedmont, and others were not. Considering the outcome, Cavour did not make a bad deal.