How Do LLMs Perform Two-Hop Reasoning in Context?