Let us just briefly recap: the knight, driven into a desperate state by his unsuccessful search to the answer to the question posed to him by the queen, comes across the old woman the night before he has to give his answer or else pay the forfeit. He throws himself upon the mercy of the old woman, who agrees to help him, but only if he agrees to do something for her in return. Consider what she says to him:
"Put your hand in mine and pledge your word," said she,
"That you will do the first thing I require
Of you, so be that it lies in your power,
And I shall tell it to you before night."
Thus the knight agrees, desperate to find the answer and save his life. It is only later that the old woman reveals what the thing she requires of him will be: his marriage to her. This of course allows the Wife of Bath the opportunity to display how the knight is forced not just to intellectually know what it is that women desire, but to live it out in his marriage as well.