What did Muhammad retreat to a cave outside of Mecca?

Options:
He wanted to escape corrupt Meccan society
He was looking for wisdom from god
He had been told by an angel to go there
He was hiding from his persecutors

He had been told by an angel to go there and receive revelations from God.