In "The Book Thief" how did the key come to be in Max's copy of Mein Kampf?
The short answer is that Hans Hubermann taped it there. Hans had a really good war buddy who played the accordion, and that war buddy died. Hans felt really badly for his buddy, who had a wife and a child at home, who he'd never met. That child turned out to be Max. So, Hans had kept in touch, kind-of, through the years, and knew of Max and his situation. When Max went into hiding with his friend Walter, Walter went to visit Hans, hoping that Hans could help, because Walter couldn't keep hiding Max. He was afraid that they would get caught. So, Max helps pay Walter's way to go visit Hans. Walter returns and reports of Hans,
"He's good...He's not a member of the party. He gave me money...he's fairly poor, he's married, and there's a kid."
So, Hans had agreed to help out. He sent a letter with a map and directions to his house, and then, "Mein Kampf arrived, with a key taped to the inside cover." Hans knew that Max would need a key to his house, and that the key would need to be kept safe from discovery. So, he rather cleverly put it inside the one book that every "good" German would be expected to be reading, and that is "Mein Kampf." Max found this very clever, and took off on his journey, making it safely to the Hubermann's house.
I hope that helps a bit; good luck!