ZFC works as a foundation because it can prove many sentences that are "translations" of theorems from "standard" mathematics into the language of ZFC.
But there's a subtlety. When we say, "ZFC can found most of mathematics," what do we really mean?
Do we mean
- ZFC proves most theorems (suitably translated into the language of sets) in the mathematics literature
- A metatheory that makes sense of "consistency" + the assumption that ZFC is consistent can be used to prove most theorems (suitably translated into the language of sets) in the mathematics literature
- A metatheory that makes sense of "models" + the assumption that ZFC has a model can be used to prove most theorems (suitably translated into the language of sets) in the mathematics literature
- A metatheory that makes sense of "models" + the assumption that ZFC has a standard model can be used to prove most theorems (suitably translated into the language of sets) in the mathematics literature
- Something else?
We mean that we can formalize the needed languages, and theories, and we can prove the existence of sufficient models for "regular mathematics" from ZFC.
This means that within any model of ZFC we can show that there are sets which we can interpret as the sets for "regular mathematics". Sets like the real numbers with their order, addition, and so on. And all the statements that you have learned in calculus about the real numbers and continuous functions, and so on -- all these can be made into sets which represent them and we can write proofs (which are other sets) and prove that these proofs are valid, and so on. All this within sets, using nothing but $\in$.
The key issue is that all this happens internally, so it happens within every model of ZFC, or rather in every universe (even if it is not assumed to be a set in a larger universe on its own).