The force of friction depends on the type of surfaces rubbing together. The rougher the surfaces, the more friction. Not only that, but also the greater the contact between two surfaces, the more friction. For example, bike racers usually have skinny and smooth tires on their wheels because both of those factors create low friction and allow them to go faster. Mountain bikers on the other hand want a lot of friction and grip with the ground, thus they use wide and knobby wheels for a lot of friction and grip with the ground. In the question you asked, sand is placed on ice and sidewalks to create a rougher surface and thus more friction and grip with the ground to prevent people from falling.