Zainichi (literally "in Japan"), is a Japanese term used to refer to Chinese and Koreans who were brought over to Japan (often by force) before World War II and remained in Japan after the war ended, as well as their descendants.
Before the War, these people had been considered full citizens of the Japanese Empire, but after the War, when Japan lost her empire and Japanese citizenship was redefined to include only ethnically Japanese people, the Koreans and Chinese left in Japan were considered to be foreign nationals, and were obliged to get passports and other documents from Korea and China. Over the years, they often faced discrimination in daily life and particularly in the job market, as well as being the target of negative stereotypes portraying them as lazy or more prone to criminal activity.
To this day, their descendants still carry passports from Korea or China, and are not considered Japanese citizens, even though they only speak Japanese and no one in their family has been anywhere outside of Japan since their great grandparents' generation. Even though it has now become a lot easier for zainichi to apply for and receive full Japanese citizenship, many have refused out of pride and anger after years of bad treatment.
Strictly speaking, the term "zainichi" only means "in Japan" and can be used for anything which is "in Japan." The fuller term for these persons of questionable nationality residing in Japan would be zainichi chosenjin ("Koreans in Japan") or zainichi chugokujin ("Chinese in Japan"), but just abreviating them to "zainichi" allows Japanese speakers a simple way to refer to the whole group, and often appears in compounds such as zainichi mondai ("The Problem of the Zainichi") or zainichi hanzai ("Crime committed by Zainichi"). "Zainichi" has also become the standard term to refer to these people in Western academic scholarship on Japanese society.