How do you explain the formula Fe3O4 using the ionic compound theory?
Iron forms both $\ce{Fe^2+}$ and $\ce{Fe^3+}$ ions. The first combine with oxygen ions to $\ce{FeO}$; the second $\ce{Fe2O3}$.

$\ce{Fe3O4}$ can be thought of as a mixture of both compounds in equal amounts. So $\ce{Fe3O4}$ contains both Fe(II) and Fe(III) ions; twice as much Fe(III) as Fe(II).

In the picture below, showing the crystal structure, green atoms are Fe(II) and brown atoms Fe(III). All Fe(III) atoms are linked with six O atoms, sharing 'half an electron' with each oxygen; all Fe(II) atoms are linked with four O atoms, and all O atoms are linked with four Fe atoms.



(source: Manoj B. Gawande, Paula S. Branco, and Rajender S. Varma, Chem. Soc. Rev. 2013, 42, 3371-3393. DOI: 10.1039/C3CS35480F See also: ResearchGate
)