Hong Kong is China since 1997 with same nationality law that's the reason its called one country and two systems. Obviously the thin layer between two system is getting thinner, because like any law, basic law can be interpreted to suite the needs of how the two systems should be.
I believe all of this is happening given China does not want to be another USSR. Hong Kong was used as a launch pad to do the same and ruling establishment learning from the past actions in cold war between US and USSR cracked down heavily using the interpretation of basic law to suite their needs. It was inevitable, just the time-line shortened due to the kind of chaos Hong Kong went through with violent protests.