The advent of scalp magnetoencephalography (MEG) based on optically-pumped magnetometers (OPMs) may represent a step change in the field of human electrophysiology. Compared to cryogenic MEG based on superconducting quantum interference devices (SQUIDs, placed 2-4 cm above scalp), scalp MEG promises significantly higher spatial resolution imaging but it also comes with numerous challenges regarding how to optimally design OPM arrays. In this context, we sought to provide a systematic description of MEG spatial resolution as a function of the number of sensors (allowing comparison of low-vs. high-density MEG), sensor-to-brain distance (cryogenic SQUIDs vs. scalp OPM), sensor type (magnetometers vs. gradiometers; single-vs. multicomponent sensors), and signal-to-noise ratio. To that aim, we developped an analytical theory based on the physically-grounded technique of MEG multipolar expansions. In a first step, we show that the theory (together with experimental input) enables rigorous, analytical, and quantitative assessment of the limits of MEG spatial resolution in asymptotically high-density MEG. In a second step, we enlarge the theory using simulated data to encompass MEG at lower sensor density, and we build a full description in terms of two qualitatively distinct regimes. The resulting two-regime model of MEG spatial resolution integrates known observations (e.g., the difficulty of improving spatial resolution by increasing sensor density, the gain brought by moving sensors on scalp, or the usefulness of multi-component sensors) and gathers them under a unifying theoretical framework that highlights the underlying physical mechanisms. It also reveals new properties of the limits of MEG spatial resolution, such as their logarithmic divergence at asymptotically high density or their saturation as sensors approach sources of neural activity. We propose that this framework may find useful applications to benchmark the design of future OPM-based scalp MEG systems.