Why were diseases such a threat in cities during the Industrial Revolution?

Because everyone lived in such close quarters and they didn't understand the nature of bacteria and viruses so their lifestyle wasn't very sanitary as well as the lack of vaccines and proper medicine.