Biology is complex, I expect no single answer, and many modes of action are unknown. Humans are made of proteins just like viruses, so any answer like "the sterilizing compound binds with the amine function" would probably be wrong as it doesn't differentiate the target from the organism to be spared. This knowledge is essentially experimental, with explanation attempts afterwards hence doubtful.
One mechanism I read about soap (other forum members know it better) is that it degreases. Many viruses and bacteria are protected with a sheath of lipids that soap dissolves, while humans can survive with some fats less on the skin - within limits. You can find by yourself on the Web how soap acts on grease.
Hydroalcoholic gel versus soap: soap is perfectly efficient. I suppose alcohol acts faster, hence is precious to professionals. Hydroalcoholic gel is hence requisitioned for hospitals, which is absolutely meaningful, and to my opinion understandable by the population. I disagree with the governments that allege "gel is less efficient", "face masks don't protect" and more propaganda because they consider the people is an idiot. And I don't grasp how plain alcohol and masks could be in shortage in rich industrial countries after a month. Encouraging individuals and companies to act would be better.