"Nearly 40 percent of the world's population lacks access to toilets." -- Wikipedia on Toilet
The word toilet used to refer to a cloth used to cover cloths while grooming or to grooming supplies. It is still, although rarely, used to refer the act of grooming or putting on cosmetics. Sometimes the word toilet is used to refer to the room holding a toilet (and usually a sink). Other names or euphemisms for the room or the toilet are a john, lavatory, water closet, the necessary (archaic), bathroom, commode, crapper, dunny, head, powder room, potty, throne, latrine, shit house, restroom, throne.
Basically this is the appliance or furnishing where people get rid of their waste (to urinate or defecate) and "flush" away the waste. In developed parts of the world, the waste is removed as sewage, usually treated and released. The treatment of human waste helps stop or control the spread of certain diseases.
A toilet provides convenience and sanitation.