First, "foundations" are not what they once used to be. The idea of "one true logic" and "one true mathematics" justifiable from self-evident truths does not have much currency these days. So interest in real foundations, and belief in their existence or necessity, has been consistently waning, see Azzouni, Is there still a Sense in which Mathematics can have Foundations?
The Frege-Russell's project of transforming mathematical practice into formal enterprise did not come to fruition either. $ZFC$ is getting textbook lip service as a check on paradoxes and a source of mathematical logic curiae, but the actual proofs are still given essentially in the vernacular of naive set theory, see comments in the MO thread for current reactions. It is more prominent in mathematical logic and higher set theory, where the plethora of technical results on first order logic, on independence and consistency strength, and the fact that more complex theories are transparently modeled in it, turned $ZFC$ into a convenient common yardstick, a lingua franca of the field. But that, as with Latin or English, is, in part, a historical contingency.
Now, how it happened, Kanamori's The Mathematical Development of Set Theory from Cantor to Cohen is a detailed source. After the loud controversy over his axiom of choice Zermelo in 1908 set up a system $Z$ of seven axioms (AC not included) that "started from set theory as it is historically given... to exclude all contradictions" and "to retain all that is valuable". The authoritative summary of set theory, Hausdorff's Grundzüge der Mengenlehre (1914), which was to become Bourbaki's inspiration, did not incorporate it, see How Set Theory Evolved From Hausdorff Until Today. Hausdorff considered axiomatizations premature, and used refined naive set theory instead. But in 1910-1913 Russell and Whitehead published their Principia Mathematica, which accomplished a formidable task (with largely unacknowledged help from Schröder's Algebra der Logik (1890-1905)): it convinced the initiated that all of mathematics known to date could, in principle, be fully formalized.
Over the course of 1920-s two major developments took place: von Neumann and Fraenkel added axioms of regularity and foundation to $Z$, and the primality of first order logic started emerging. The latter is often credited to Skolem and Hilbert, see How did first-order logic come to be the dominant formal logic?, but it was solidified by Gödel's theorems that displayed its technical virtues. Ironically, Gödel originally proved incompleteness in $PM$, which was not first order, and Zermelo, who endorsed $Z$ with additional axioms in 1930, the modern $ZF$, advocated its second order reading. How $PM$ was gradually washed out of circulation due to its maze of ramified types and clumsy notation, can be seen, in part, from Who superseded Peano's dot notation in symbolic logic and when? So the early alternatives fell by the wayside. When Bourbaki started putting out their Éléments de mathématique in 1939 their axioms were not quite Zermelo's, but the system was equivalent to $ZFC$ minus foundation, see On Bourbaki's axiomatic system for set theory.
What about later alternatives? Gödel showed that $PM$'s theory of types was equivalent in consistency strength and expressive power to $Z$, which was simpler and closer to the vernacular. Bernays, anticipated by von Neumann, proposed a set theory with classes, $NBG$, adopted by Gödel in 1940, which was proved to be a conservative extension of $ZFC$. Quine, another influential advocate of first order logic, proposed New Foundations in 1937, later $NFU$, which also turned out to be bi-interpretable with $ZFC$. By 1960-s it became clear that genuine alternatives (see SEP survey) concern themselves with matters that ordinary mathematicians need not concern themselves with. And $ZFC$ had the advantages of simplicity and familiarity. For comparisons with later non-set-theoretic "foundational" alternatives, such as category theory or recent univalent foundations, see Dzamonja, Set Theory and its Place in the Foundations of Mathematics.