A Gaussian surface is nothing more than an invisible bubble that you draw in space. The “inverse square law” of gravity can actually be rewritten as “the total amount of gravity pointing into the bubble is proportional to the amount of matter inside the bubble”. The matter inside the sphere has remained the same, so the pull at the surface of that sphere remains the same. The sphere doesn’t pull the star, and the star doesn’t pull the sphere. Now, put a Gaussian surface around a star.