I mean, it's kind of both: objects have gravity, which attract them together, which creates more gravity and larger objects. Stars are what happens when the rest of physics disagrees with this (and black holes are when gravity wins anyway).