Tail docking in pigs is performed to prevent tail biting, but is itself a painful procedure; better housing and enrichment can reduce biting without docking.
Tail docking removes pain-sensitive tissue and causes acute and potentially chronic pain. It treats the symptom rather than the cause of tail biting. Addressing root causes - stocking density, enrichment, ventilation, nutrition - is preferable for both animal and production welfare.