There are a lot of geographical shifts for Moon Shadow, and the move from China to America is a pretty huge one. He leaves the hard work but comfort of his small family farm and finds himself in a foreign land rife with racial tension and cultural shifts.
During the late 1800s, many Chinese immigrants were coming to the United States, which many native-born Americans found very threatening. Particularly in California, white workers feared that Chinese immigrants would take away their jobs. As a result, laws like the Chinese Exclusion Act of 1882 were passed. You can learn a lot about American immigration policies regarding Chinese immigrants and immigrants from other countries in Shmoop US History's guide to "Immigration: Era of Restriction."
What this means for Moon Shadow, immigrating to the United States two decades after the Exclusion Act is passed, is that there's definitely that sense of fear and anger toward Chinese people. Those mindless "Ching Chong Chinaman" taunts that Jack throws at Moon Shadow are not unique to the world within this book (7.41-44). Moon Shadow has to embark on a new life in a foreign country, but he has to figure it out while adapting to a land where people will treat him poorly because they associate him with larger political stuff going on. Granted, this is not a one-way street of xenophobia; Moon Shadow has plenty of ungenerous assumptions about non-Chinese people, too (they are called "white demons," after all). Bottom line: the setting is super important to contextualize Yep's larger message of belonging within our real world and history.