The people of Yathrib belonged to the tribe of al-Khazraj and the tribe of al-Aus. They promised our Master Muhammad [s] to support Islam with their lives and money.
When the Quraish harmed the Muslims severely, our Master Muhammad [s] ordered them to immigrate Yathrib.
So, the Muslims began leaving Makkah secretly, one by one, or group by group. Al-Hamza bin Abdul Muttalib immigrated, too.
The immigrants and the supporters in Yathrib were eagerly waiting for our Master Muhammad's immigration. They were looking forward to his arrival.