When you wash clothes at home in the washing machine, water is the solvent used to do the cleaning. Many types of fabric, however, do not handle water very well. For example, wool and water just don't mix. There are also many types of stains that water is not particularly good at removing.
The term dry cleaning is a little misleading, in that it isn't actually dry. Instead, it means that instead of using soap and water, dry cleaning employs chemical solvents that remove dirt and grease and eliminate stains. One of the earliest solvents used was kerosene, which had the downside of being flammable. After World War II, dry cleaners began to use a solvent called perchloroethylene, also known as perc, which became the industry standard because of its effectiveness. Once clothes are cleaned with the solvent, the chemical itself is extracted and reused, and the clothes are pressed to eliminate wrinkling. The clothes are washed in this solvent, and then the solvent is recovered in an extractor so it can be reused (and so that it does not evaporate into the air and cause pollution). Once the clothes are cleaned, they are pressed so they look like new.
Perc has a serious downside, in that it's been linked to a range of different health risks. In 2020, the EPA phased out the use of perc in cleaner shops situated in buildings where people also live, and the state of California is in the process of phasing out its use altogether. Though perc is still being widely used, other more environmentally friendly solvents have been developed in an effort to reduce risks to workers and the consumer. In addition, a process called wet cleaning, which utilizes water and biodegradable detergents in special computer-controlled machines, is advocated by the EPA and environmental organizations.