First it means that which happens by force, i.e., what cannot fail to happen because of the power exerted by the thing applying force. Second, it means taht without which a thing does not fare well--either that without which a goal cannot be attained at all (as food is necessary for the life of an animal), or that without which something is not in a perfect state (as a horse is necessary for a journey in the sense that it is not easy to make a journey without one). Third, it means that which cannot be other than it is, but is necessary absolutely and essentially. (2532)
The local motion of the sphere of the heavens is not necessary by force, because it is the natural motion of an imperishable thing. Likewise, it is not necessary absolutely and essentially. Therefore it must be necessary by the end, and thus, says Aquinas, "it is on this principle, i.e., the first mover as an end, that the heavens depend both for the eternality of their substance and the eternality of their motion" (2534).
All three are ways in which something cannot be otherwise than it is; but they are very different senses. It's notable that of these senses of necessity we usually mean the third and occasionally the first, but the second only comes up colloquially. And yet it is precisely the second that is at stake when we are talking about the ingenerable and imperishable, which is perhaps why we don't find 'necessity' to be such an intuitive word in this context (and, indeed, as long as the Aristotelian thesis of the coextensiveness of ingenerable and the imperishable is kept in mind, it makes much more sense for us to talk about it in terms of what is imperishable). What is imperishable is such that it has no natural way to perish: its ends are such that it always tends to be, and therefore there is a sense in which it cannot be otherwise, i.e., is necessary.
Incidentally, note two things: (1) because the heavens move all else, Aquinas in the commentary on the Metaphysics is again considering the world as a whole; and (2) that when we get to the second stage of the Third Way, Aquinas appeals not to moving causes but to efficient causes, even though he often (following Aristotle) appeals to moving causes elsewhere in similar contexts. And the reason, I think, is this: the Third Way is meant to be a fairly clean and neat summary, but the relation between the first mover and the imperishable is complicated by the fact that Aristotle thinks the world had no beginning, whereas Aquinas does. Aquinas thinks God could have created an eternally moved world, of course; but he thinks that in fact he didn't. And that this can rather considerably complicate things can be seen from the Summa Contra Gentiles, where he attempts to tackle this difference head-on in the course of the discussion of the first mover argument. But the Five Ways are all formulated so as to avoid any complication of that sort, in keeping with the goal of the Summa Theologiae. And thus the Third Way is formulated so as to avoid the question of eternal motion altogether.