The good news is that the process is clear once you see the order of steps. This page covers how it works for mainland companies, how free zones handle it, and the tax and visa pieces that people often forget.
An expired licence doesn't close the company. The company still exists on record, and so do its obligations. RAK FTZ, for example, warns that not following the deregistration procedure results in penalties and possible legal action. Tax registrations also stay open until you cancel them, and the Federal Tax Authority sets firm deadlines for that (see below).
If you're unsure whether to close or keep the company dormant, it's worth checking renewal costs against closure costs first.