First of all, please note that it is not necessarily true that China’s currency is undervalued relative to the American dollar. There is no foolproof way to determine what the “proper” value of a currency is. Many Americans believe that the yuan is undervalued; others, as in this link, do not believe this is true.
If we assume that the yuan is undervalued, China would want it that way because a weak currency is good for exporters. When China exports goods to the United States, American buyers have to buy yuan in order to pay for the goods. If the yuan is weak relative to the dollar, every American dollar that the buyer has will buy more yuan and, thereby, more Chinese goods. This will make Americans more likely to buy those goods. Therefore, a weak yuan is good for China’s exports.
If China is manipulating they yuan, how would it be doing so? It could do so by buying and selling yuan and dollars. Exchange rates are typically set through supply and demand. If people want a great deal of one country’s currency (high demand), the price of that currency will rise, all other things being equal. If people are trying to sell a lot of another country’s currency (high supply), that currency’s value will decline. So, if the Chinese government wants the yuan to get weaker relative to the dollar, it should try to buy dollars and sell yuan. By selling the yuan, it increases supply of that currency, lowering its price. By buying the dollar, it raises demand for that currency, increasing its price.