Penelope recognizes Odysseus by the marriage bed: he describes how he built it around an olive tree that grew in the courtyard, and only someone who had been in that room could know it. The scene is in Book XXIII and is the endpoint of the poem.
When the nurse Eurycleia tells her that her husband has returned and killed the suitors, Penelope does not believe it. She thinks some god killed them and that Odysseus lost his return and died far away. She goes down to the hall and remains silent a long time, looking at the man in rags, now face to face, now without recognizing him. Telemachus rebukes her: her heart, he says, is "harder than stone." Penelope answers that, if he is truly Odysseus, they will recognize each other better, because they have "signs that we two also know, hidden from others."
The test comes after the hero takes a bath and is made beautiful by Athena. Penelope has Eurycleia spread the bed outside the room he built himself. Odysseus is irritated and asks who moved the bed elsewhere, something no mortal would do without effort, because there is a great sign in it. He describes an olive tree with long leaves that grew in the courtyard, thick as a column: he built the room around it, cut its crown, trimmed the trunk, and made the bed from it. And he concludes: "thus I declare this sign to you; and I do not know whether the bed is still firm for me, woman, or whether some man has already put it somewhere else, cutting the base of the olive tree from below." At that moment Penelope's knees and heart give way.
The bed matters because it is a sign that no one else can pretend to know. The scar, which the nurse had already cited, does not convince her; the bed is a secret of the couple, and Penelope recalls that not even Helen would have given herself to a foreign man if she had known she would be taken back home. It also says a great deal about marriage: a bed fixed to the earth by a root is the image of a bond that does not move. The poem adds a simile: the husband is as welcome to her as firm land appears to the swimmers whose ship Poseidon shattered at sea.