Double PWM signals with High frequency

I have a same problem on arduino nano, i use PWM frequency library for 20Khz and use pwmWrite (9, val1), bute when use analogWrite(10, val2), both generate 20khz pwm and duty cycle is correct. But I'm not sure if it's reliable.