The relationship between both countries goes back to the Treaty of Wanghia in 1844. Among other issues, the treaty fixed trade tariffs, granted U.S. nationals the right to build churches and hospitals in specific Chinese cities and stipulated that U.S. nationals cannot be tried in Chinese courts (instead they would be tried in U.S. consular offices). Since then the relationship has fluctuated coming closet to open conflict during the Korean War.
Second Sino-Japanese War/World War II:
Beginning in 1937, China and Japan entered into conflict that would eventually combine with the Second World War. The bombing of Pearl Harbor officially brought the United States in the war on the Chinese side. During this period the United States funneled a great amount of aid to help the Chinese. The conflict ended simultaneously with the end of the Second World War and the surrender of the Japanese in 1945.
Both China and the US got involved in the Korean War in support of the North and the South respectively. This was the only time when soldiers from both countries actually fought as the U.S./U.N. forces battled Chinese soldiers upon China's official entrance in the war to counter American involvement.
The Taiwan Issue:
The end of the second world war saw the emergence of two Chinese factions: the nationalist Republic of China (ROC), headquartered in Taiwan and supported by the United States; and the communists in the Chinese mainland who, under the leadership of Mao Zedong, established the People's Republic of China (PRC). The U.S. supported and only recognized the ROC, working against the recognition of the PRC in the United Nations and amongst its allies until the rapprochement during the Nixon/Kissinger years.
The United States and Russia have still found plenty over which to clash. The United States has pushed hard for further political and economic reforms in Russia, while Russia bristles at what they see as meddling in internal affairs. The United States and it allies in NATO have invited new, former Soviet, nations to join the alliance in the face of deep Russian opposition. Russia and the United States have clashed over how best to settle the final status of Kosovo and how to treat Iran's efforts to gain nuclear weapons.
In the late 60's and at the height of the Cold War both countries had a reason to start negotiating in hopes of a rapprochement. For China, the border clashes with the Soviet Union in 1969 meant that a closer relationship with the U.S. might provide China with a good counterbalance to the Soviets. The same effect was important for the United States as it looked for ways to increase its alignments against the Soviet Union in the Cold War. The rapprochement is symbolized by the historic visit of Nixon and Kissinger to China.
The disintegration of the Soviet Union re-inserted a tension into the relationship as both countries lost a common enemy and the United States became an undisputed global hegemon. Adding to the tension is China's rise as a global economic power and the expansion of its influence to resource rich areas such as Africa, offering an alternative model to the United States, usually termed the Beijing consensus . The more recent opening of the Chinese economy has meant closer and increased trade relationships between both countries.