(This is about motivation (the why) of defining and adding a standard socket to devices and ment as an addition to Stephen Kitt's great explanation of the technical side - at some point a merge might be useful)
Most home electrical appliances use a fixed power cord and have a on/off switch near the front.
That's due the fact that for appliances sold in large numbers to the same (restricted) market, it's less costly to have fixed power cord.
Why did computer equipment appear to start the trend?
It's not just computer and measuring devices but many others that are sold to markets with different standards in plugs.
While there are only a small number of power standards regarding voltage and frequency that require different power supplies (before the switched PS that is), there are many different power plugs in use around the world - and most are mandatory by law or trade union standards in their region, thus can't be avoided.
Over the years, more than 30 different plugs for household usage did get some proliferation and about 15-20 are still in use. For a company with the intent to sell a product this would mean production and logistics for 15+ different versions of one device, just because of different power plugs. While this may be acceptable for huge markets like the US, Japan or Germany, it becomes expensive for smaller markets. If a product is also only sold in rather small numbers (not TVs, but measuring equipment), it's outright prohibitive.
So devices smaller markets where usually delivered just with the right power supply, but no plug at the end of the cable. In fact, this was even in medium sized markets standard until the early 1960s. After all, back then, no supermarket (if existing at all) was selling electronics, nor were there huge electronics markets around. To buy a toaster or TV one would buy at a local electrician or TV salesman - who in turn did fit the right plug before selling. Back then fixing a plug was something considered doable for everyone.
While this vanished (at least in large markets) over time due to increased volume, it stayed a problem with professional equipment. I still remember in the late 70s applying plugs to newly delivered measuring equipment as part of my job.
While mostly incompatible, some may interact with each other with some preparation. For example the French and German system of sockets can both be used by a single plug prepared for both sockets, as the difference is just how PE (protective ground) is handled (*1) and both ways can be made into the same shell. There are similar combinations for some other countries (*2), but this still leaves ~10 different plugs to support when a company intends worldwide sales.
The plug is based on a German VDE standard for 'Kaltgerätestecker' (Cold Device Plugs). German industry has a strong export orientation, even more so, that after the war Germany itself was only a small market without much buying power. The many different European plugs therefore were a serious issue for sales and production. Already in the early 1960s a standard was developed for several classes of devices, including the C13 now used with most PCs.
These intermediate couplings are structured around several (*3) features:
- 2 or 3 wire
- Current
- Temperature
The C13 is defined as 3 wire (power+PE), up to 10A and maximum of 70 degree environmental temperature (at the plug).
Other well known ones are C1, the 'razor plug', 2 wire, 0.2A, or the C5 and C7, both at 2.5A with 2 (C7) or 3 (C5) wires. The C7 was quite common with home computers with integrated PS, while the C7 is today common with laptops or other low power devices with a need for PE.
All the plugs for the different (useful) combinations became different shapes, so no two could be exchanged by error. Basically an encoding of polarity, need for PE and material at the device.
While in itself adding cost, the usage of these intermediate couplings did greatly reduce overall cost and were an instant success over manufacturer-specific solutions. Already in 1970 this VDE 0623 became an IEC standard.
Why did some computers, monitors, printers and other equipment use a replaceable power code with a non-standard socket?
To start with, it's not non-standard, but a well known and widely used standard. Already way before small computers became a thing. It was just lesser known in the US where the market was large enough to justify not to use an intermediate connector.
Computers are a prime example for machines sold in many markets with (in the beginning) only a quite small number per plug region. And with today's just-in-time production and the need to keep costly storage of finished products low, it becomes even more important. A PC will no longer be built for a specific market, but as a general, worldwide sold unit, and only customized for a target country by adding the right language CD, Manuals and power cable.
In fact, even looking at the 'big 3' early computers, Apple II, Commodore PET and Tandy Model 1, already shows the difference. Tandy and Commodore used a fixed cable, fine for the domestic market, while Apple did decide to use a switchable PS with C14 socket (for C13 plug). This decision made it quite easy to start worldwide sales. Where Tandy only had rather small sales outside the US (or better the 110V/60Hz) world and Commodore did set up factories in other countries, Apple could start worldwide sales right away from California (and later from their second plant in Eire).
One may guess that it was part thru Woz' desire to make use of a good PS, thus a switching one, but maybe more his acquaintance with professional measuring equipment, where power selectable PS and plugs at the device where already standard.
(Often the power switch was at the back)
That again is to save costs. Due the integration of switch and socket into one pre-made unit, no additional cabling is needed. The one shown in the picture even integrates a fuse, even more simplifying design and saving cost. Another benefit is that the wiring inside the computer (after the switch/socket unit, until the PS that is) is already switched, so no further protection for a hot wire even when switched off is need. And that's not only a good idea, but some countries would require additional measures for such a configuration, which thus can easy be avoided. A classic win-win in production.
*1 - Several European sockets are compatible in size, diameter and distance of the two main connectors, jut the way PE is handled differs. The French/German are also compatible in the defined area for the shell.
*2 - Even more so when it's just about two prong connections for devices that don't need PE (encapsulated or Class II devices), leading to the so called Europlug covering many more countries.
*3 - There are more deviations, like resistance to acid and spark-free plugging that are not really relevant here - including voltage, but all connectors we usually have are certified for 400V, so way above all regular two wire mains.