# Categorical Interpretation of Localization

At the very beginning of Ravi Vakil's amazingly famously amazing and famous notes on algebraic geometry, he remarks that some familiarity with localization and prime ideals is useful. I don't know anything about commutative algebra, so I was hoping for a categorical interpretation of both these concepts, or at least a nice conceptual summary from a structural viewpoint. Sources and references kindly accepted (as low level as possible please).

The localization of a ring $A$ at a multiplicative submonoid $S$ is the initial ring under $A$ in which $S$ is sent to units. (i.e. there's a localization map $A\to S^{-1}A$ and if $S$ goes to units in $f:A\to B$ then $f$ factors uniquely through $A\to S^{-1}A$.) Diagrammatically, a unit is just an element whose action by multiplication is an isomorphism.
A prime ideal $\mathfrak{p}$ is one for which the quotient $A/\mathfrak{p}$ is an integral domain, that is, a ring in which all of the endomorphisms given by multiplication by an element are monomorphisms. In this interpretation it's not immediately obvious that the complement of a prime ideal is a multiplicative submonoid, but it is, and this is the most important kind of submonoid at which one localizes.