Hey Thorium,
This is a good question and a very complex one. I don't think there is a for sure answer, but there is some good ideas. The first place to start I think, isn't with cells but rather with insects.
Meaning that, as far as evolution is "concerned" its okay for you to sacrifice yourself for an equal amount of hereditary material that can still be passed on. I suspect in early multicellular organisms it wasn't much different--Where it is okay for reproductive cells to specialize in just that while other cells provide support for those reproductive cells.
In a way, none of that has actually changed--The only thing that has, is the functions of the other cells, which have become more specialized through evolution to support those reproductive cells. In that way, at least a simplified way, you could really describe all the rest of our bodies as "support" cells for those reproductive cells.
I think to answer your exact question though, you'd have to be specific. Cell lineage specialization evolve to solve environmental problems. For instance, as multicellular colonies grew larger and larger diffusion would have been no long sufficient to supply cells with nutrients. A vascular system and corresponding cells would need to evolve to solve this problem.