The answer to 'how does outlet work' is that an electrical outlet is a socket installed in a wall or other surface that provides a connection point for electrical devices to be plugged in and receive power. Outlets are connected to the home's electrical wiring system, which carries electricity from the utility company's power grid into the home. When you plug an appliance or device into an outlet, it completes the circuit and allows electricity to flow from the power source to power the device.
Outlets typically have two or three holes - the two flat slots are for the live and neutral wires, and the round hole is for the ground wire. The ground wire helps provide a safe path for excess electricity to flow back to the power source in case of a short circuit or other electrical fault, preventing shocks or fires.