If you're using a 20Mhz oscillator the internal clock runs at 5Mhz (FOsc/4) and this is what "ticks" the timer that is used for the PWM generation. The prescalers job is to divide this 5Mhz frequency by whatever ratios are available for the particular PIC and/or timer used (normaly 1, 4 and 16 for TMR2).

If you set the prescaler to 4 the timer is incremented at 5/4=1.25Mhz instead of 5Mhz.

The datasheet for the PIC you're using has a section dedicated to the CCPModule in which they explain in great detail how it works and how to calculate the PWM period:

PWM Period = (PR2 + 1) * 4 * TOsc * Prescaler

In order to calculate the PR2 value for a specific frequency you have to rewrite the formula a bit and solve for PR2+1:

PR2+1 = 1 / (TOsc * 4 * Prescaler * PWM Frequency)

If you settle for a prescaler of 4 then this becomes:

PR2+1 = 1 (0.00000005 * 4 * 4 * 5000) = 1/0.004 = 250 so in order to get a PWM frequency of 5kHz with a prescaler of 4 you should set PR2 to 249.