Usually, a cracked or decayed tooth leads to infection of the pulp. Bacteria enter through vulnerable areas like cracks and openings in the enamel, eventually reaching the pulp. Once inside, the bacteria inflame the nerves and tissue, leading to infection.