Once the U.S. stopped quantitative easing and Europe, along with Japan, began quantitative easing, the dollar became much stronger. While this hurt U.S. exports, our economy was in recovery and could afford it. However, with the yuan pegged to the dollar, Chinese exports also dropped – but when their economy was weakening. With economic stimulus on their mind, China suddenly announced a devaluation of the yuan.
What they did is totally logical. However, what was surprising is that they announced it, when they have no obligation to do so. To understand, you have to understand the primary fear of the Chinese leadership, which is social unrest. They made the announcement, so their people could see the government was taking concrete steps to limit further economic weakening.
Of course, the U.S. stock market over-reacted, as it always does. To the U.S. investor, the Chinese announcement was an admission their economy was unacceptably weak, reducing worldwide growth, as well as reducing demand for oil and other commodities. This too will pass!