The majority of Chinese immigrants to the United States left China seeking better economic opportunities, though others left due to persecution and other hardships. Immigrants generally leave any nation for these same reasons, with opportunity or hardship being the primary driver of most migration.
Immigrants to any nation usually arrive seeking a better life. The United States was particularly attractive to poor Chinese as natural calamities and famine ensured life was particularly grim for the impoverished. As well as the economic and familial lure of the burgeoning United States, there was also a grim underbelly at work, with gangs and slavers importing Chinese women to work as prostitutes for the many workers in the American West.