Routine tail docking of piglets to prevent tail biting is legal but supposed to be a last resort in the UK. Better management can address the underlying causes and reduce the need for the procedure.
Tail docking is a painful procedure applied to piglets to prevent a worse outcome - severe tail biting injury in the herd. The underlying welfare problem is that standard pig housing conditions with high density, barren environments, and stress create a propensity for harmful behaviour. Providing adequate enrichment, space, and foraging opportunities can dramatically reduce tail biting risk, removing the need for docking. The EU's tail docking rules reflect this - the procedure is supposed to be a last resort, not standard practice.