Typhoid fever is caused by a type of bacteria called Salmonella typhi.
This isn't the same bacteria that cause salmonella food poisoning, but the two are related.
The Salmonella typhi bacteria will be in the poo (stools) of an infected person after they have been to the toilet.
If they don't wash their hands properly afterwards, they can contaminate any food they touch. Anyone else who eats this food may also become infected.
Less commonly, the Salmonella typhi bacteria can be passed out in an infected person's pee (urine).
Again, if an infected person handles food without washing their hands properly after peeing, they can spread the infection to someone else who eats the contaminated food.
In parts of the world with poor sanitation, infected human waste can contaminate the water supply.
People who drink contaminated water or eat food washed in contaminated water can develop typhoid fever.
Other ways typhoid fever can be contracted include:
Up to 1 in 20 people who survive typhoid fever without being treated will become carriers of the infection.
This means the Salmonella typhi bacteria continue to live in the carrier's body and can be spread as normal in poo or pee, but the carrier doesn't have any noticeable symptoms of the condition.
After eating food or drinking water contaminated with the Salmonella typhi bacteria, the bacteria moves down into the digestive system, where they will quickly multiply.
Left untreated, the bacteria can get into the bloodstream and spread to other areas of the body.
This can cause the symptoms of typhoid fever to get worse during the weeks after infection.
If organs and tissues become damaged as a result of the infection, it can cause serious complications, such as internal bleeding or a section of the bowel splitting open.
Read more about the complications of typhoid fever.