The capacitor could be either a small capacity capacitor installed to reduce RF, in which case it should be installed as near to the motor power supply inputs as possible.
However very high capacity capacitors are available and are used on the power inputs of those super high powered car sound systems bogans sometimes cruise
the streets with, in order to supply sudden heavy current
draws by the noise producing equipment
. If this is the purpose the capacitor should also be wired in as close to the power input to the compressor
I have a portable fridge I sometimes use which has starting problems and will cycle on/off two or three times to get started when the house batteries
are low which could probably benefit from this arrangement.
10,000 UF 40V-50V capacitors are readily available for this purpose.