A code audit is a structured review of a codebase and its delivery setup that finds risks in architecture, quality, security, performance and maintainability, and ranks what to fix. Technical due diligence is a code audit plus an assessment of the team, roadmap, scalability and intellectual property, run for an investor, acquirer or board before a decision.
Uvik Software, for example, runs both on the same method, so a founder can audit before a fundraise and an investor can commission the same review independently.