Bismillah iRahman iRahim
(Whatever is correct below, all praise is for Allah, The Creator; any error is due to human fallibility).
The year 622CE corresponds to the most significant turning point in the history of humanity - The Hijra. This refers to the migration of the Muslims to Yathrib (more popularly known and, afterwards, referred to as Madinah). There are people who wrongly describe this hijra of the seal of the prophets Muhammad (saw) and the Sahaba (ra) as fleeing persecution by the kuffar among the Quraysh. It is hoped that a sound view regarding this event will be portrayed below.
Prior to The Hijra, Muhammad (saw) had taken the 2 pledges of Aqaba. The second was known as the 'pledge of war' - The Prophet (saw) had now been accepted as the ruler of Yathrib by its leaders. As a popular base of Believers had been built by Mus'ab, Yathrib was ready and willing to live under Islam. The Hijra therefore highlights Islamic strength - Dar ul-Islam had been established. We know that what followed was migration, consolidation and propagation.
There had previously been persecution, torture and murder in Makkah. As a result, a number of Muslims went to Abyssinia (Ethiopia). The Prophet (saw) remained in Makkah and was even offered to become the ruler of it later on by the disbelieving Quraysh. He (saw), of course, did not compromise at all.
Even during and after the 'Year of Grief' we can observe that the Prophet (saw) persevered. After meeting people from Yathrib, he (saw) sent Mus'ab there whilst the other Sahaba remained with him (saw) in Makkah. This was until, as mentioned above, Yathrib was ready to become Madinatun Nabi - City of The Prophet.
To end, The Hijra was an event indicating the strength of Islam, not the opposite. May Allah (swt) protect the Believers from cowardice and make them courageous. Amin.