Why Dobby Warns Harry in Chamber of Secrets
In the book, Dobby doesn't "see the future." He warns Harry because:
- Lucius Malfoy's Plot: Dobby serves the Malfoys. He overhears Lucius planting Riddle's Diary on Ginny Weasley to reopen the Chamber of Secrets.
- Loyalty to Harry: Harry frees Dobby (accidentally, via sock) in Chamber of Secrets—but Dobby's warning precedes his freedom. Dobby warns Harry before Book 2 events, hoping to prevent his return to Hogwarts where the plot unfolds.
- Self-Punishment: Dobby hurts himself (ironing hands, banging head) for betraying his masters—house-elf magic enforces obedience.
Movie difference: The film shows Dobby intercepting letters; the book has him sealing the barrier and bewitching a Bludger—all to keep Harry away.