In public health, "quarantine are used to protect the public by preventing exposure to infected persons or to persons who may be infected. Quarantine is used to separate and restrict the movement of well persons who may have been exposed to a communicable disease to see if they become ill. Quarantine can also help limit the spread of communicable disease."
Isolation is used to separate ill persons who have a communicable disease from those who are healthy. The term reverse isolation refers to keeping immunosuppressed or otherwise vulnerable patients away from sources of infection.
Governments often have extremely strong powers to quarantine, superseding normal rules on detention. On a worldwide basis, the current system of agreements go back to 1948. 
While the idea of keeping sick people away from healthy ones goes back into antiquity, the formal term "quarantine" comes from 14th Century practice in Venice. "Ships arriving in Venice from infected ports were required to sit at anchor for 40 days before landing. This practice, called quarantine, was derived from the Italian words quaranta giorni which mean 40 days." Quarantine has long been associated with ships; specific flag hoists, such as the yellow "Q" alphabet flag, mean "disease on board".