To someone who is new to driving, or even riding a bicycle, in China the traffic in some places, particularly the less-developed places, can seem quite lawless, selfish and chaotic. However, once you understand how things are done in this part of the world you will be better able to avoid accidents and knowledgeably negotiate China’s roads.
Many of the road signs, signals and markings in China are similar to those in other countries, but that is where the similarities end. The People’s Republic of China Road Traffic Safety Law has a bias towards reducing collisions and being polite, which actually states that law-abiding citizens should give way politely to those breaking the law and driving impolitely. This is actually no different to in the West, except that there are more vehicles with a greater range of sizes and speeds, with a far greater percentage breaking the law and being driven selfishly. So traffic is slowed down and brought into chaos by those who want to get somewhere faster than laws and politeness will allow. Even in this condition traffic flows as road users anticipate obstruction and weave their way through.
The rule is that all traffic should drive on the right hand side of the road, to the right of the center line. If there is no center line the rule says that vehicles should drive in the center of the road, until there are two vehicles coming towards each other in opposite directions, when both vehicles should move to their right to let one another past, when safe to do so.

From experience, an obvious reason why vehicles do not always drive on the right hand side of the road, regardless of road markings, is that the middle of the road is the safest place to be. There are often pedestrians, and parked or slow-moving vehicles on the right hand side of the road, and vehicles often emerge from side roads without a safe gap in the traffic to do so. Therefore the incidence of oncoming vehicles is often less than the incidence of obstacles on the right of the road, hence the rule. It is easier to see obstacles in front and avoid them from a position in the center of the road.
If you are cycling (or driving) in the middle of a road and the vehicle behind sounds the horn or indicates that it wishes to overtake, the law says you should as quickly and as safely as possible move over to the right and allow it to overtake.
If a vehicle is approaching you on the wrong side of the road you are expected to make way as far as possible, even if this means stopping and pulling over all the way to the right hand edge of the cycle lane.