Friction depends on the normal force rather than the force of gravity because friction is fundamentally a response to the force that surfaces exert on objects in contact with them. The normal force is the force exerted by a surface perpendicular to the contact area and is equal in magnitude and opposite in direction to the force the object exerts on the surface due to gravity.
When two surfaces are in contact, there are microscopic irregularities and interlocking between them. Friction arises due to the interactions between these surfaces at the microscopic level. The normal force determines the degree of contact and the strength of these interactions.
The force of gravity, on the other hand, is a vertical force acting on an object due to the gravitational attraction between the object and the Earth (or any other massive body). While gravity plays a role in determining the weight of an object, it is not directly involved in the generation of friction.
When an object rests on a surface, the normal force counteracts the force of gravity and prevents the object from sinking into or passing through the surface. The magnitude of the normal force affects the strength of the intermolecular interactions between the surfaces, which in turn determines the amount of friction between them.
In summary, friction depends on the normal force rather than the force of gravity because it is the normal force that establishes the contact and interactions between surfaces, which are responsible for the resistance to relative motion.