A bacterial nail infection occurs when bacteria infect the skin surrounding the nail, typically caused by secondary ingrown toenails or trauma. Symptoms may include redness, swelling, tenderness, and pus around the affected nail. It's important to seek professional help from a podiatrist for proper diagnosis and treatment.