When you put them together, 洗(xǐ) + 手(shǒu) + 液(yè) creates the transparent meaning of “wash-hand-liquid,” which perfectly describes its function.
While hand soap itself is a universal product, the emphasis on its use holds particular cultural weight in modern China, largely shaped by recent history. The nationwide experiences with public health crises like SARS (2003) and especially COVID-19 (2020) dramatically elevated the importance of public hygiene. Slogans like “勤洗手, 多通风” (qín xǐshǒu, duō tōngfēng - “Wash hands frequently, ventilate often”) became ubiquitous on posters, in subways, and on television. Compared to the West, where hand hygiene is often seen as a matter of personal preference, in China it took on a strong sense of civic duty and social responsibility. Using 洗手液 became a collective action to protect not just oneself, but one's family, colleagues, and the wider community. This ties into the cultural value of collectivism (集体主义 - jítǐ zhǔyì), where the well-being of the group is paramount. You will now find dispensers of 洗手液 at the entrance to nearly every mall, office building, and restaurant, a direct and lasting legacy of these public health campaigns.
洗手液 is a neutral, everyday term used in all contexts, from formal to informal.