The short answer, explained
Underpaid tax on its own doesn't lead to prosecution. HMRC opens hundreds of thousands of compliance checks and enquiries each year, and the vast majority are resolved through the civil penalty system: extra tax, interest, and a percentage-based penalty.
Criminal investigation is reserved for cases HMRC considers serious and deliberate, typically involving sustained concealment, false documents, or organised evasion, rather than an isolated error or even careless behaviour over several years.
Even where HMRC suspects fraud, its published strategy is to prefer the civil route where the taxpayer cooperates. The Contractual Disclosure Facility under Code of Practice 9 is a formal offer of immunity from prosecution for the specific matters disclosed, in exchange for a complete and accurate account.

