ELI5: Why does placing bread in a container of cookies soften the cookies?

Why does it make the cookies soft and the slice of bread rock hard? And why does this trick only work once?