There are three known ways of transferring heat from one place to another -- convection, conduction, and radiation.
Convection is the transfer of heat from one region to another by the actual movement of hot material. Convection occurs when you boil a pot of water and the hot water rises to the top -- the hot water from the bottom of the pot displaces the cooler water near the top, and the cooler water, being denser, sinks to the bottom of the pot. Convection is also the primary driver of weather systems: hot air rises and cools, so water vapor condenses to rain, etc. The movement of hot liquids and gases redistributes the energy of the system, moving more energy to cooler regions and away from hotter regions.
Conduction is the transfer of heat from one solid object to another and occurs only at the interface (boundary) between those two materials. Conduction also occurs when boiling a pot of water, but it happens at the boundary between the stovetop (aka. "hob", "burner", "hot plate") and the bottom of the pot (or between the pot handle and your hand!). No actual material is exchanged between the stove and the pot, but heat is transferred from the stove to the pot via conduction.
Note that "conduction" in the context of heat transfer is different from conduction in the context of electricity. A material can be a good conductor of heat but a poor conductor of electricity.
Radiation is the transfer of heat by the emission of particles. These particles are often (but not always) photons, which are particles of light. One of the most familiar types of radiation we experience is the radiation of photons by the Sun (which carries heat across the vacuum of space to our planet). Strongly radioactive materials like uranium-235 also emit lots of other kinds of particles via radiation; in this case, the uranium generates heat by turning small amounts of matter into energy via fission. This is how nuclear power plants work -- they dunk radioactive rods of material into big water tanks, boil the water, and use the steam to spin a turbine, creating electricity.
The most common methods for cooling electronics are using fans and heat sinks. Fans remove excess heat by pushing the hot air away from a chip or some other component. Thus, cooling fans facilitate convective cooling.
Heat sinks are odd-shaped pieces of metal that attach to chips, effectively increasing their surface area so they can more easily transfer heat to their environment. At the boundary between the chip and the heat sink, conductive heat transfer occurs. At the boundary between the heat sink and the air, convective heat transfer occurs.
"Heat transfer is most efficient by convection, then by conduction; radiation is the least efficient and slowest means of heat transfer. Low efficiency of heat transfer means that vacuums make excellent insulation."
...this is why vacuum flasks ("thermoses") are so good at keeping your hot drinks hot and your cold drinks cold!
Convection, being the most efficient form of heat transfer, is already the best way to cool our heat-generating electronics. So can we do anything else to cool them faster? As it turns out, we can.
"That's where water cooling comes in. Water has a higher thermal conductivity than air - it can move heat faster than air can. Water also has a higher specific heat capacity. It can absorb more heat before it starts to feel hot."
-- [ Source ]
Specific heat is an inherent property of a material, which gives the amount of energy required to raise the temperature of a unit mass (usually a gram or a kilogram) of that material by one degree Celsius. It is closely related to the heat capacity of a material. The specific heat of water is about four times the specific heat of air. This means it takes about four times as much energy to heat a specified mass of water than it does to heat an equivalent mass of air by the same amount.
As mentioned above, water is also a better conductor of heat than air is. The thermal conductivity of water is more than twenty times as great as air.
The above two properties of water mean that water can carry more heat energy than air, and it can move it away from your sensitive electronics more quickly. Obviously, these sensitive components can't simply sit in water they way they "sit" in air, so how does the water actually cool these components?
Liquid-cooled PCs operate similar to how car radiators work. A coolant sits in a circuit of tubes and the coolant is warmed by the heat of the engine (or the computer). The radiator (just a big reservoir filled with liquid) may or may not physically touch the parts that need to be cooled, but heat can be transferred from the engine / chips to the material which contains the liquid, to the liquid, all via conduction.
Note that "water" throughout the above text is a simplification. This liquid often contains antifreeze-like components or other additives. If you want a huge challenge, you can also build a "submerged" PC, in which every component is literally submerged in mineral oil. Mineral oil is also used to cool high-powered electrical equipment like the transformers you see on telephone poles.
Thanks for reading!