In a refrigerator, the compressor is a mechanical device driven by an induction motor. This about how motor works (as opposed to how a compressor works. The characteristics of a compressor have some influence, but the essential answer is given by the characteristics of a motor independent from what it is driving.
The motor draws a higher current when it is switched on. That would happen even if it was not connected to anything. The high current persists for the time required for the motor to reach full speed, a fraction of a second or perhaps slightly more than a second. The fact that the load is a compressor influences the time, but probably not by enough to be important in this context. The refrigerator likely has the largest motor in the house other than the central air conditioner.
For the purpose of explaining why a motor draws a high current while starting, use the schematic shown below provides a simple explanation. The motor consists of a resistor and a generator that generators a voltage that opposes the supply voltage. The voltage is proportional to speed. When the speed is zero, the opposing voltage is zero and the current is high. As the speed increases, the opposing voltage increases and causes the motor current to decrease.
That diagram would apply best to a permanent-magnet DC motor, but it should serve well enough for an induction motor in this context.
The actual light dimming can be explained as the high current starting the motor briefly overloading the supply. Alternatively, you can include wiring resistance and a light in the schematic.
For a more comprehensive equivalent circuit, refer to my answer to: When load increases in rotor of induction motor how does stator draws more current?
The equivalent circuit for one phase of a three-phase induction motor is presented there. It contains the expression Rr(1-s)/s that is a resistance representing the mechanical load driven by the motor.
In that expression s is the motor's slip, the difference between the speed of the rotating magnetic fields and the relative speed of the rotor. When the motor is switched on, the rotor speed is zero and the speed of the magnetic fields is 1, so the slip is also 1 and the portion of the circuit representing the mechanical load has zero resistance. That means that the remainder of the circuit determines the current. That represents a low impedance, so the initial current is high.
As the motor speed increases, the value of s reduces from 1 to about 0.03. That results in a higher resistance that reduces the motor current, but absorbs most of the electrical power that is transferred to the motor from the source.
The results on analyzing the equivalent circuit for one phase of a three-phase induction motor are simply multiplied by three for a three-phase motor. The equivalent circuit for a single-phase motor includes two such circuits, but the two circuits are not identical. However the general principal is the same.
Here is another question in which my answer uses a more simplified version of the equivalent circuit for a three-phase induction motor: Why does an induction motor draw more current when the load is increased?