It is well known that the metal-insulator transition in two dimensions for non-interacting fermions takes place at infinitesimal disorder. In contrast, the superconductor-to-insulator transition takes place at a finite critical disorder (on the order of V_c ~ 2t), where V is the typical width of the distribution of random site energies and t is the hopping scale. In this article we compare the localization/delocalization properties of one and two particles. Whereas the metal-insulator transition is a consequence of single-particle Anderson localization, the superconductor-insulator transition (SIT) is due to pair localization - or, alternatively, fluctuations of the phase conjugate to pair density. The central question we address is how superconductivity emerges from localized single-particle states. We address this question using inhomogeneous mean field theory and quantum Monte Carlo techniques and make several testable predictions for local spectroscopic probes across the SIT. We show that with increasing disorder, the system forms superconducting blobs on the scale of the coherence length embedded in an insulating matrix. In the superconducting state, the phases on the different blobs are coherent across the system whereas in the insulator long-range phase coherence is disrupted by quantum fluctuations. As a consequence of this emergent granularity, we show that the single-particle energy gap in the density of states survives across the transition, but coherence peaks exist only in the superconductor. A characteristic pseudogap persists above the critical disorder and critical temperature, in contrast to conventional theories. Surprisingly, the insulator has a two-particle gap scale that vanishes at the SIT despite a robust single-particle gap.