Quarantine gets its name from a fourteenth century practice of requiring ships to dock in Venice harbor forty days before landing to prevent the spread of the Black Plague. (Quaranta is Italian for forty.)
While this sounds reasonable today, one has to wonder about the logic in a world where germs and contagious disease were unknown and inconceivable. Disease theory consisted of the imbalance of humors (blood, black bile, yellow bile, and phlegm) and various individual differences in environment, life style, and disposition. Two millenia of medical science barely recognized diseases as unique one from the other or contagious.
Certainly some ships came from far away and had already seen plenty of time at sea, while others were local. Why quarantine all for forty days? Were there political, social, or racial reasons for these rules? Were exceptions made?
Quarantine started as an approach to isolate locations, originally ships, but later homes and villages were quarantined.
An second approach was to isolate people. Quarantine locations began with leper colonies or lazarettos (after the parable of Lazarus). In this case, people were isolated at a location designated for that purpose. Again, recall that there was no concept of contagion. Most likely these people were isolated because others did not want to be near them or see them.
Quarantine today is most often used in this second sense. At international borders pets may be sent to quarantine facilities.
In summary, some quarantine regimes are “no entry” regulations, much like the original Venician rules, but now extended beyond potentially sick people to include fruits and vegetables that can not be brought into places like California or Australia. Other quarantines are “no exit” isolations like the lazarettos. These are rarely seen today, though during the most recent Ebola panic in the United States, some people seemed ready to reinstate this practice.