If I answered “because of the gravitational pull that Earth exerts on us, duh”, I wouldn’t be wrong and some of you would be pleased with that answer alone and leave this page. Not being wrong doesn’t mean the question is answered though.
The truth is, we don’t know because we don’t know how gravity works. We can, however, measure gravity and we know that with distance, it’s force is inversely proportional to the square distance of the object emitting it.
This is the inverse-square law which applies when some force, gravity in this case, is evenly radiated outward from a point source, like Earth and Sun are, through the three-dimensional space. This means that gravity works with the same power in all directions.
Now, imagine a hollow sphere 100 million kilometres around Earth and the surface of this sphere is equal 4πr^2 where “r” is its radius and at the same time distance from Earth. Gravitational force from Earth is equally distributed over this surface. Now imagine a second sphere around Earth, but this one has its surface at 200 million kilometres from Earth. This sphere has radius two times the radius of first sphere but its surface is four times larger than the surface of the first sphere because in the formula above, “4” and π are constant and “r” is squared, so when we double the radius, the surface is quadrupled.
Since the gravity is distributed equally in all direction, this means that at any point of the surface of this second sphere, gravity is four times weaker than at any point at the surface of the first sphere, keeping in mind its distance from Earth merely doubled compared to the first sphere’s distance.
Now, let’s get back to the original question. You are standing on the Earth and it’s gravitational acceleration “g” is 9.81 m/s^2. gravitational acceleration on the surface of the Sun is 274 m/s^2, which is almost 28 times “g”, but you are standing on the surface of our planet and our star is almost 150 million kilometres away. This is why you are “glued” to the Earth’s surface. Make no mistake my friend, if Earth suddenly magically disappeared, you’d still continue to orbit the Sun. You are always affected by its gravity, but compared to Earth’s, its weak at the surface of our home.
We still don’t know how exactly do these large objects attract you because we don’t know how gravity works. It is best described in Einstein’s general theory of relativity which says that massive objects curve the spacetime and that Earth basically orbits the Sun in straight line, but on curved three-dimensional space. We still don’t know why would it curve the spacetime though.
From a point of view of quantum field theory, seeing it as one of four fundamental forces, gravity is theorized to be mediated by a particle, just like electromagnetic force and strong and weak interactions. This proposed particle is called graviton, but it is not discovered yet and theorists have a problem unifying gravity with other three fundamental forces. They are thought to be part of the same force, that was separated into four forces as temperatures in the Universe dropped, but graviton is yet to be found and four forces are yet to be unified in one theory of everything.