First off, one should get out of the way that there are no "virtual particles popping in and out of the vacuum" - this is a bad picture of quantum field theory whose reference is uncertain; it could refer to a result involving the Reeh-Schlieder theorem, or it could refer to how that vacuum states possess fuzzy field values at each point in space. Hence, given this is wrong, there can be no "taking in one particle and spitting out another". In fact, the positions of involved particles are so quantum-mechanically fuzzy that the fuzziness is bigger than the black hole event horizon by several times. Also, "quantum foam" is an altogether different concept, which belongs to still-hypothetical fully-quantum mechanical models (which actually go beyond Hawking's original idea) of spacetime, referring to quantum fuzziness or indeterminacy in the geometry of spacetime itself.
What, then, is going on? The answer is that if an agent is initially informed that a black hole is present with a given mass and space around it is vacuum, then it will project a future history of that black hole involving a steadily-growing quantum amplitude that there are radiation particles outside. Likewise, the expected value of the black hole mass will be dropping. This process is very complicated to describe precisely in terms of mathematics, but it is (at least I believe) what is going on from a conceptual or intuitive point of view(*).
Broadly, such is the same thing as what happens with an unstable atomic nucleus. An agent which has initially been informed that the nucleus exists and is of a given unstable type, will then project a future history with rising quantum amplitude that the nucleus is in some once- or even multiply-decayed form, and that there are fragments or radiation particles present outside. And in either case, if the agent then queries the system at this later time for its decay state, there is likewise greater probability that such decay will be recorded as having taken place.
To put it another way, Hawking radiation is nothing more or less than the radioactive decay of a black hole. The black hole is coupled to nongravitational quantum fields, and these provide channels by which it can lose energy. But the precise shape of the decay curves is different between the two situations - we get a simple decay to stability for the radioactive nucleus, while for the black hole the decay becomes more and more furious as its mass is depleted, meaning more and more and more particles are sent forth. There is a singularity here as the black hole mass goes to zero - this singularity represents a limit of the theories used to derive the black hole decay, namely semiclassical gravity.
(*) I should note I am taking this via the subjective/informational conception of quantum states; one may of course argue for an alternative interpretation. Something has to be used, after all.