Why does human nature have "irascible" appetites? St. Thomas Aquinas, in explaining why we have an irascible faculty–which though named from "anger", ira, includes all appetite aimed at attaining goals which are difficult, and which require overcoming obstacles (not necessarily enemies)–makes a comparison with all natural and corruptible things, and says that things which are fallible, and can be hindered from reaching an end, need to have an inclination not only to seek their end, but also to overcome obstacles.
One might here raise an objection: in the case of man, at least, the desire for a good or pleasant end should be enough, since when a person is seeking an end, then he will not only go towards that end out of his desire for it, but will also push aside or go through obstacles out of that same desire. Take the case of a man who desires to untie a package. If he encounters difficulty in untying the knot, his desire to untie the package is enough to make him persevere, without getting angry or high-spirited, or being dead set on finishing the untying whatever happens. In fact, he may be less effective if he gets angry at the knotted cord. To what purpose then an additional appetite aimed specifically at overcoming this obstacle?
Leaving aside for a moment this particular example, I'll try to expand on St. Thomas's explanation, and then then return to discuss the particular case.
The sensitive appetites do not attain to the account of the good as such, but directly concern very particular goods. Hence, anything painful has a nearly direct contrariety to pleasurable goods. Moreover, as Plato remarked, we estimate a pleasure or pain that is present to us as greater than an actually equal pleasure or pain in the future. For these reasons, a present difficulty or pain involved in seeking the goods we want, by lessening the desire aroused by our imagination of these goods, would hinder our efforts to attain them. For example, a man trying to push a heavy stone in his garden in order to make room to plant more vegetables, will be at least somewhat put off by his hand hurting.
In order to be more successful in attaining the goods we want, in the face of difficulties, we have a special desire which is aimed at the “difficult good”. Such a desire is not directly mitigated by the difficulty or pain involved, but indeed strengthened, though it can be indirectly weakened, inasmuch as the desire on which it is based (the desire of attaining something good and pleasant) is weakened by the difficulty or pain. To avoid even this indirect mitigation from being too substantial, the irascible appetites have a kind of independence from the simple desires on which they are based. Once someone, foreseeing great difficulties in winning a prize in a contest, steels himself to do so, he may well persist in his attempts, even if he no longer has the original desire to win the prize—if he learns that it is not what he thought it was. Similarly, when a person who is angry with someone because he thinks the other person cheated, learns that they didn't, he may remain angry… and perhaps think of other bad things the person did, to “justify” the anger.
This distinct and somewhat independent desire for achieving difficult goods, precisely because of its specific relationship to what is difficult, and its independence from simple desire for what is good or bad, supports us far more in seeking future goods when things get difficult than the simple desire for them would. The flip side of this, however, is that this desire can support us too much. If the person becomes really resolved to move that stone whatever happens, he may break his wrist in the process, a result that isn't justified for the sake of growing a few more vegetables. Anger especially in many cases moves us more than is justified. It is probably mostly useful in situations where (1) physical aggression is required, or (2) a particular person is disposed to inertia even when notices injustices which he could and should rectify.
Returning to the particular case of the knotted package, it is probable that anger, or even great determination is not particularly useful in this case, unless the best way of opening the package is ripping the rope by bare strength (supposing no knife is available, and the knot can't be untied). But this doesn't show that anger or spiritedness is unnecessary, only that it is not perfectly well directed. Anger, spiritedness, determination are helpful in overcoming specific kinds of obstacles, or in specific situations for specific persons, but as immediate appetites not perfectly governed by reason, these appetites of anger, determination, drive, etc., are also often aroused in situations where they aren't so helpful.