The explanation is as follows. Gravity is the force of attraction between all matter. Although gravity exists for even small amounts of matter, the force is usually not significant enough to detect or generate pull. Gravity is usually referred to in relation to planets or astronomical bodies -- massive objects that generate significant gravitational pull; enough to condense matter to form planets and keep them in orbit. In addition to mass, gravity also depends on the distance between two bodies, which is the reason why the Earth's gravity affects humans more than more massive bodies, such as the sun or Jupiter. In short, it is the huge mass of earth a major reason for causing gravity. Also since mass of moon is less as it's small, so it's force of gravity is also less. Hope it answers your question. Stay curious, keep learning. All the best!