She was Rosemary's predecessor and died because she didn't want to take part in the ritual.
The other answers already pointed out the Tannis root charm that Terry was wearing (and that is later given to Rosemary) and her story about the Castevets picking her up from the street and caring for her. So it is strongly hinted that she was raised by them to conveive and carry Satan's child, as Rosemary was later on.
But there is a slightly more direct allusion to her actual death and its reasons, even if we (as well as Rosemary) might at first not be able to draw the connection as clearly. In the night of Terry's death, Rosemary has a slightly strange dream about a nun arguing with a priest, actually impersonated by the Castevets, and the nun argues that
If you' d listened we wouldn't have had to do this! We'd have been set to go now instead of having to start from scratch! I told you not to tell her in advance! I told you she wouldn't be open-minded!
What actually happens here is that Rosemary hears the real Castevets arguing through the walls (it has been clarified multiple times that the walls are a bit thin and she can sometimes hear their chants) and she builds the dialogue and persons she hears right into her dream, in which they make as few of a sense as the rest of the dream.
But from this dialogue it is clear that Roman tried to let Terry in on the outrageous plan they had for her, but she didn't want to take part in it which resulted in her death. It is not entirely clear, though, if she actually committed suicide (maybe because she already did conceive the baby) or if she just tried to escape through the window and it was an accident. But what is clear is that her death is a direct consequence of the Castevets telling her about their ritual. So it does set the whole story in motion in so much that from then on the Castevets turn their efforts towards Rosemary (and in fact the next moring Minnie first approaches Rosemary), this time keeping everything secret (at least from her). Without Terry dying, there wouldn't even have been a need for involving the Woodhouses at all.