The question you've raised is an interesting one that pertains to the early moments of the universe. The reason the universe did not collapse into a black hole shortly after the Big Bang is primarily attributed to several key factors:
Expansion: In the immediate aftermath of the Big Bang, the universe underwent a rapid phase of expansion known as cosmic inflation. This expansion caused the universe to rapidly grow in size, counteracting the force of gravity's attempts to pull matter together. As a result, the universe's expansion prevented it from collapsing into a black hole.
Homogeneity and Isotropy: The observed homogeneity (uniformity) and isotropy (sameness in all directions) of the universe on large scales suggest that the matter and energy were distributed fairly evenly in the early stages. This uniformity helped prevent the formation of localized regions of high density that could have led to black hole formation.
Initial Conditions: The initial conditions of the universe, including its density and the distribution of matter and energy, were determined by the conditions of the Big Bang itself. These initial conditions set the stage for the subsequent evolution of the universe, and it appears that the conditions were not conducive to the formation of a black hole.
It's important to note that our understanding of the early universe is still an active area of research, and there are ongoing efforts to refine our theories and models. While we have a good understanding of the universe's evolution after the first fractions of a second, the precise details of the very early moments, including the exact mechanisms that prevented collapse into a black hole, are still being investigated.