Why friction is attractive force whereas normal reaction is repulsive? Both friction and normal reactions are contact forces. And according to what my textbook states both are of electromagnetic in origin. If so why normal reaction, say a block on a table pushes it away from it that is repulsive whereas when block starts to slide the friction tries to keep it at its position that is attractive.
In short if both arises due to contact and both are of same origin why one is attractive and other is repulsive?
 A: Friction is quite complicated; but it can often thankfully just be approximated and simplified with the Coulomb Friction model (with friction force proportional to normal force and a friction coefficient).
A sliding block has the two surfaces interacting as they slide past each other.  Depending on the materials, there may be more tendency for attractive forces between the two surface materials.  This can resist motion when the two surfaces try to stick.
When the surfaces are rough, the rough texture creates bumps which also have repulsive force when they try to move against the other surface.  Two rougher surfaces would have more dramatic bumps, and those repulsive forces can stop them from moving across each other when there is high normal force pushing the rough surfaces into each other.  If the surfaces were both rough and attracted to each other, it would be very hard to slide them past each other.
An interesting example of high friction from adhesion would be gauge blocks which are metal that will strongly bond itself together through inter molecular forces hold the blocks together very tight.  In practice they are lubricated; but in a vacuum they stick even without.  The lack of  normal force shows a case where Coulumb Friction doesn't really work.
A: It is due to the fact intermolecular forces are generally attractive but when the molecules get too close with each other they become repulsive.
There is a desired distance between 2 molecules , it is like a spring . If you contract the spring , it wants to have a bigger size when you expand it it wants to have a smaller size.
The surface of any object is just like an uncompleted puzzle . You can put new pieces but if those pieces start pushing the rest of the puzzle , it resists.
