At 50Hz, the impedance of the cap is much lower than the impedance of the resistor, so it is actually the cap that limits the current.
Now, why is the 470K resistor added across the capacitor? The resistor is there to discharge the capacitor when the power is switched off.
Without it, the capacitor may stay charged to a few hundred volts after the power is switched off. Anyone who touched the pins on the mains plug after it was unplugged could get a nasty shock.