I live in Guangdong, and this is what I've been seeing & reading about.
Wuhan (city in Hubei) is where the outbreak supposedly began. And it went unnoticed for a while, which mean it was spreading locally more-so than it was spreading nationally/internationally. Near at the start of the Chinese New Year holiday, the government decided to quarantine all of Hubei province. So while other provinces already had infected people, they spread hadn't grown as significantly as it had in Hubei yet.
The Chinese government then decided to take specific measures to control the epidemic. For starters, they required mask-wearing and encouraged staying indoors. They also began to set up body temperature checks all over the place (apartments, neighborhoods, roads leading into cities, and places of work once the holiday ended. Fever seems to be the first symptom, so this is why).
If anyone in an apartment building was confirmed to have the virus, then the entire building and all residents were/are quarantined for 14 days (happened to a 30+ story apartment building next to mine). Elevators, doors, and other public spaces are often disinfected, particularly if a suspected case had been in the area. Again, I saw this at a temperature checkpoint, someone must've had a fever and a little bit later some folks came and sprayed down the area.
Schools are also closed in all provinces across the country, and students are doing online schooling. Some companies are also allowing employees to work from home, or 'staggering' their work days (half come in into the office on Mon, Wed, Fri, the other half come in Tuesday and Thursday). This decreases the number of people a possible infected person can pass the virus to.
On top of this, companies needed to 'apply' to be able to resume work. Here in Shenzhen, nobody could return to work within 14 days of returning from the city, assuming they left during the holiday. We also need to record down our body temp when coming to and leaving from work. According to an SMS I received from the local government, if 2 employees have a body temperature >= 37.3C, then it needs to be reported immediately, as it indicates a possible spread in that workplace.
In short, the virus was able to take a foothold in Hubei, and it was noticed before it took a significant foothold in other provinces. Therefore other provinces had time to implement proactive and preventative measures, before the situation grew to Hubei-level of significance.
The best way to prevent it from spreading is simple steps, such as not going outside unless its necessary, avoid close contact with others (defined as within 6 feet for an extended period of time), washing your hands, and disinfecting often-touched surfaces like door knobs, keyboards, cell phones, etc. It remains to be seen whether other countries will take the same rather drastic measures that are being taken in China, I suppose it all depends on how bad things get in other countries.