Few-layer CrI$_3$ is the most known example among two-dimensional (2D) ferromagnets, which have attracted growing interest in recent years. Despite considerable efforts and progress in understanding the properties of 2D magnets both from theory and experiment, the mechanism behind the formation of in-plane magnetic ordering in chromium halides is still under debate. Here, we propose a microscopic orbitally-resolved description of ferromagnetism in monolayer CrI$_3$. Starting from first-principles calculations, we construct a low-energy model for the isotropic Heisenberg exchange interactions. We find that there are two competing contributions to the long-range magnetic ordering in CrI$_3$: (i) Antiferromagnetic Andersons superexchange between half-filled $t_{2g}$ orbitals of Cr atoms; and (ii) Ferromagnetic exchange governed by the Kugel-Khomskii mechanism, involving the transitions between half-filled $t_{2g}$ and empty $e_g$ orbitals. Using numerical calculations, we estimate the exchange interactions in momentum-space, which allows us to restore the spin-wave spectrum, as well as estimate the Curie temperature. Contrary to the nearest-neighbor effective models, our calculations suggest the presence of sharp resonances in the spin-wave spectrum at 5--7 meV, depending on the vertical bias voltage. Our estimation of the Curie temperature in monolayer CrI$_3$ yields 55--65 K, which is in good agreement with experimental data.