My mini fridge had a frosty back wall, so I turned it off for 24 hours. There was water on the floor through the back of the fridge, why it happened?
Well you kind of have the idea but not quite. The evaporator is the cooling side of the loop - this is where the frost forms. Depending on the size, it may or may not have a defrost cycle.

My mini-fridge in my shop has a defrost and the water drains into a pan on top of the compressor, the heat from the compressor accelerates the evaporation (some fridges only have a large drip pan). My guess is you have a fridge where the "ice box" is the actual evaporator - this is quite common in small units. When the moisture drains out, there is no pan or drip trays to catch the water, in many cases because these need to be manually defrosted, so all the moisture ends up on the floor.

In the case where there is a pan or tray, it may have been too small to catch all the water and you already guessed that with the fridge off there is no heat from the compressor to aid the evaporation of the water.

The parts of a fridge are the compressor, the condensing coil (many times this is outside the case but in some it can be enclosed) and after the condenser coil there is a metering device sometimes as simple as a small orifice or tube, but on larger high-end fridges it can be a thermally controlled valve. Then the evaporator and back to the compressor to complete the loop.

To answer the last question: will the excess water cause a safety problem with the electrical? My answer is it won't be a problem as even very inexpensive units have the power enclosed and I have never seen more than a slip hazard or damage to the flooring from this moisture.