First of all, gratitude? Why? I'm not the one you're giving this to, its the PAA. I'm not some stooge you can buy or bully to say what you want, so don't talk down to me as if you're being generous to a homeless man.
Second, why would China give them to Iraq, or Afghanistan? Wouldn't make much sense. Iraq's military is worthless, and has no time to induct a Chinese platform that is completely different to what they're used to with Russian and US platforms. Afghanistan doesn't have the technical know how, nor the money to keep up maintenance, giving these to Afghanistan would be the height of stupidity, as it nay very well end up in the hands of either India or the US, or even worse, the Taliban who'd sell it to the highest bidder. Thankfully, China's military leadership is smart.
It's not about confidence, its about need. This isn't free, as you claim. Pakistan is going to evaluate this platform, as would any nation, and China is going to use this opertunaty to gain valuable data.
It isn't just the Chinese who do this, every arms dealing nation does thus, including the US and Russia. Are you suggesting that China is different and special? From what I can tell, China is no different, nor should it be any different.