How is a quarantine supposed to work?
The idea behind quarantine is to isolate people who are or may be infected, in order to prevent them from transmitting the illness to others, or to sequester healthy people and make sure they stay healthy. If you restrict someone's movements beyond the incubation period of the infection, you can isolate new cases as they come up, prevent the spread of infection, and treat those who fall sick.
There's some elasticity in what qualifies as a quarantine. Not being allowed to leave home, or being kept in isolation within a hospital, are pretty strict forms. Sometimes quarantines are not mandatory, but self-imposed by individuals who think they might be sick and doing the right thing by waiting out the incubation period (or recovering from illness) before going out in public again.
Quarantines are only one of a list of actions that can be taken to increase social distancing and help "flatten the curve"—limit the number of cases at any one time, so the peak caseload is much easier for health-care systems to manage.