The virus first hit the city of Wuhan in China and then spread to surrounding cities inside Hubei province, consecutively making its way to all other provinces. Such a rapid spread happened because of the timing – just around Chinese New Year, when all Chinese people go to visit relatives.
The travel also happened to the relatives living in other countries. That’s how first cases outside of China started to appear. First infections in the countries outside of China were mostly people from Wuhan. Such infections are called imported cases. If the cases are isolated fast enough, the high chance that the virus won’t spread further.
The next step to contain the virus would be contact tracing – identifying all the people that infected came into close contact with. Such people are usually asked to self-quarantine or are tested and isolated as well, depending on each country’s decision to act. At this point, it’s close contacts of the imported cases which the virus spread to.
However, when new infection appear in a country and there’s no apparent link to the previous cases (imported or close contacts), the virus is said to reach a community spread level. At this stage, the virus circulates in the country and has a very high potential to cause epidemics.