Tuberculosis is a bacterial disease
Tuberculosis - often shortened to TB - is a disease due to infection by bacteria of the genus Mycobacterium.
Mycobacterium tuberculosis is the main causative organism, but there are others e.g. Mycobacterium bovis.
Interestingly, leprosy is caused by a different species of Myobacterium.
It is mainly known as a disease of the lungs (pulmonary TB).
Inside the lungs the bacteria become enclosed inside structures called tubercles, which explains the name.
However other parts of the body can be also affected if the bacteria leave the lungs.
Tuberculosis is usually spread by droplet infection
but it can sometimes also be transmitted from a mother to her baby via the placenta
When an (actively) infected person coughs, sneezes or spits (or even talks, sings, laughs or kisses!), bacteria are forced out in the aerosol produced. This can be breathed in, and potentially spread the infection widely.
However the greatest risk occurs when larger numbers of people - young and old - are crowded together in a confined space, as occurs in many slum dwellings. A very comparable situation occurred in the UK in the industrial areas until the beginning of the 20th century.

Coughs and Sneezes
a 1945 "health propaganda trailer"
made by the Ministry of Information
for the Ministry of Health