The short answer is gravity. Gravity exists between any two objects but it is weak unless there is a lot of mass. In the absence of any other forces a gas, or any other material for that matter, will form a sphere because of those gravitational forces.
If the cloud is small enough it will be subject to other forces and won’t be really spherical, but with enough size it will keep its shape more. Jupiter would be a good example of that.
Latest Answers