Both audits test the same thing: whether your ISMS meets ISO 27001 and runs the way your documents say. They differ in who runs them and what happens with the result.
The internal audit belongs to your company. You decide when it happens, who does it and which part of the ISMS it covers, within the limits of Clause 9.2. The auditor can be an employee from an unrelated team or an outside firm, as long as they are impartial. Findings go into your own report, and you fix them on your own timeline.
The certification audit belongs to an accredited certification body and runs in two stages. Stage 1 reviews your documents and checks that you are ready, including whether an internal audit and a management review are planned and have been carried out. Stage 2, usually a few weeks later, tests whether the controls work in practice. Their findings go on the record, and a major nonconformity has to be closed before the certificate is issued. After certification the same body returns once a year for a surveillance audit.
In practice the internal audit is the one you can learn from without consequences. Many companies schedule it six to ten weeks before Stage 1, so there is time to close what it finds. The certification auditor also reads your internal audit report, so a thorough one makes their visit easier.