China does this for many reasons. In part it is to keep their economy moving, in more than a few sectors their ability to produce exceeds demand and shutting down this capacity has real unemployment and financial implications. I’ve personally seen these loans being used to promote the purchase of Chinese goods in the form of little to no interest on them. Of course they are also looking to establish a larger profile in the world and cash is a great way to do it.
This is also a warning to those who are strong isolationist/nationalists. Making the Trans Pacific Partnership (TPP) a political issue and summarily pulling out of it has left the weaker countries near China, who were supposed to be party to the TPP, looking to China for trade deals. This will pull them closer into China’s sphere of influence. The current transactional approach to trade pushes away those who are our strongest allies and those who’s rather have their economic ties to us and not China or even Russia. You can argue some about the “fairness” of these general trade deals, but these are complicated things and complicated to assess.
Some of us have been fooled into thinking the large caches of arms, ships, planes, and other chunks of metal conclusively define our projection of power. The reality is that soft, diplomatic power is cheaper and often more successful. We are also in a new world of warfare based in 0s and 1s and it’s been well demonstrated that we are vulnerable. Just because we “won” the Cold War doesn’t mean we will dominate the new world order unless we learn to move forward.