Before us is Mishnah 13 in chapter 13 of Maseches Yevamos, which deals with a woman who vows not to benefit from her yavam, her husband's brother, and with the question of how to treat her when she comes before him for yibum. The principle that emerges from the Mishnah hinges on the timing of the vow: did she vow during her husband's lifetime or after his death, and accordingly it is determined whether the yavam is compelled to perform chalitzah or whether he is merely asked to do so.
"Hanoderes hana'ah mi'yevamah bechayei ba'alah":
A woman who vowed not to derive benefit from her yavam while her husband was still alive, and afterward her husband died and she came before the yavam - we do not attribute her vow to a desire to exempt herself from the mitzvah of yibum. The assumption is that she wanted no connection with her brother-in-law from the outset, and that is why she vowed, and not in order to sidestep the mitzvah of yibum.
Therefore, "kofin oso sheyachlotz lah" - the yavam is compelled to give her chalitzah, and we do not accept the claim that yibum could have been an option had she not sought to extricate herself from it. What is more, at that time she also collects her kesubah from her late husband's property.
"L'achar misas ba'alah":
But if she vowed after her husband's death, at a time when she had already come before the yavam for yibum, it stands to reason that she vowed in order to remove the possibility of yibum from the table. In such a case, "mevakshin heimenu sheyachlotz lah" - the yavam is not compelled to perform chalitzah; he is merely asked to do so. If he agrees, he also gives her her kesubah.
However, if he does not wish to perform chalitzah for her and she is prepared to forgo her kesubah, he is compelled to perform chalitzah.
"V'im niskavnah lechach":
If it is clear that even during her husband's lifetime she vowed with the intention of avoiding the mitzvah of yibum - for example, her husband was ill and she knew it - then even though she vowed during her husband's lifetime, her status is like that of a woman who vowed after his death: he is asked to perform chalitzah for her, and the yavam is not compelled to give her chalitzah.
In summary: The Mishnah distinguishes between a vow that the woman made during her husband's lifetime, which we do not attribute to an intention to be freed from yibum, and therefore the yavam is compelled to perform chalitzah and she receives her kesubah; and a vow she made after her husband's death, where there is an assessment that she intended to eliminate yibum, and therefore he is only asked to perform chalitzah - unless she forgoes her kesubah, in which case he is compelled. And wherever it is evident that her intention was to be freed from yibum, even if she vowed during her husband's lifetime, he is not compelled but merely asked.