Infection in wisdom teeth is often associated with partially erupted wisdom teeth. When wisdom teeth are partially visible above the gumline, bacteria can enter the exposed area, leading to infection and the formation of an abscess, which results in swelling and pain.