How and why China devalues its currency?

I am sure all of you have heard US President Donald Trump accuse China of manipulating China's currency. He claims that China devalues its currency in order to stay competitive. Let's break that down and see how and why China…