Friction occurs due to the roughness of the surfaces.
Also friction occurs fundamentally because, at a molecular level, two materials brought into close proximity tend to attract each other. The cause is mostly an effect know as Van der Waals interactions. This positive interaction, summed up over all the atoms of the surfaces in contact, adds up to be a significant force that we perceive as resistance to movement. That resistance is what we call friction.
There are however, a couple of complicating factors. Most importantly, not all materials interact with equal strength, and also, the degree of contact is greatly magnified on rough surfaces, leading to a larger total sum of attraction. This is all neatly summed up by the friction constant μ, a value that is easily determined experimentally using the equation below.