How to choose PWM frequency?
The cutoff frequency of the lowpass filter you are using determines how low a frequency you can use and still have it be smooth. But your cutoff frequency places an upper limit on how quickly the output signal can respond. So if your cutoff frequency was 1kHz, you aren't going to be able to produce a 100kHz signal. You will probably only get to choose your filter if this is a DAC. If this is a power application like a motor, then the filter has already been chosen for you (the motor inductance).
If this is not just a DAC and you are actually driving a lot of current with the PWM, then you can't use too high a frequency either because this increases switching losses and will overheat your switches.