But 漢字 has been developed in other ways in China and Japan. As you know, People's Republic of China adopted simplified characters after Chinese revolution. 漢字 is drawn as 汉字 in this way. Most Japanese people cannot read these simplified characters. But it's not so difficult to imagine what they mean. Because they were invented from same characters.
People in Hong Kong, Taiwan, and many other Chinese people who had lived other countries since before Chinese revolution are keep using traditional characters. But Japanese 漢字s are also different from these characters a little. For example, the traditional character of "people" is 民眾. And it's simplified as 民众 in mainland China. But it's simplified as 民衆 in Japan.
Nevertheless, Chinese people and Japanese people can imagine same things looking at same 漢字s. 木 reminds us trees no matter we are Japanese or Chinese. We can also understand that 北京 means "northern capital" and 東京 means "eastern capital" by only looking the 漢字s. But don't know how to pronounce them each other.