Gravity is the weakest of the four forces, but it dominates at astronomical distances.
Gravity & the expansion of the universe are neatly balanced to produce a life-friendly universe.
If the balance were off by 1 part in 1060, the universe would expand too quickly or collapse too quickly to form stars, planets or people.