Usually, we don’t wire electrical appliances together by attaching the cable directly to the wall. Instead, we use plugs and sockets. A socket defines a shape that the plug must match. In an analogy to software design, the socket is an interface.
Now we can plug any electrical appliance to this socket. The ability to replace one end without changing the other is similar to a central software design principle called the LISKOV SUBSTITUTION PRINCIPLE.
This principle states that we should be able to replace one implementation of an interface with another without breaking either client or implementation.