minimum-working example for schematic diagram of a compressor
It is sufficient to know that a fridge has a motor. When it starts, it takes a huge surge of current until it has reached the target speed. Wires have resistance. So when there is current running in wires, there is a voltage drop due to resistance. So the voltage drops at the lamps too when the motor takes a surge of current, and that voltage drop is easily visble as dimmer lamps.