What is the root cause of elasticity of a material? I know that there exist some interatomic and intermolecular forces in the material but why does stretching a material will enhance attractive force over repulsive force and vice versa. 
 A: The basic idea is, that a condensed matter system can be described by a collection of particles, that have pairwise interaction forces. These can be written as derivatives of a potential $V(\vec r_1, \ldots, \vec r_n)$. (Technically, we get such a potential for the nuclei, which move much slower than the electrons due to their higher mass, by doing a Born-Oppenheimer separation of the electronic and nuclear degrees of freedom, this potential therefore includes quantum effects due to the electrons, such as repulsion due to the Pauli principle, the positions of the nuclei are localized in the lattice and determine the shape of the crystal, while the electrons are delocalized over the entire crystal).
These forces have two significant qualitative features:


*

*They are attractive at large distances and fall off to zero at infinity.

*They are strongly repulsive at short ranges.


This means, in between there must be an equilibrium point, where the two particle forces vanish. For the multiple particle system the equilibrium point is described by the condition:
$$ \nabla_{\vec r_i} V = 0 \quad \text{for all } i = 1, \ldots, N.$$
By the qualitative features discussed above we know that there are at least local minima in the potential landscape (crystals sit at a global minimum, while amorphous systems are "quenched" at local minima and are therefore only "metastable").
So the atoms of a solid are in equilibrium (at $T = 0$ in the usual sense from statics, as long as we ignore quantum effects, which are relevant for some lattices, e.g. noble gases, where we have to include zero-point energy in the discussion). If they were not in equilibrium the would move towards a local minimum (and then, given a suitable dissipation mechanism, reach a local minimum) or simply fly apart.
So we know, that the atoms in a solid are at a minimum of the potential landscape. If we now displace them slightly by an external force, they will try to move back to their previous positions, as that position is a minimum in the potential, no matter what direction we move them, the internal forces will oppose the external force. (And if they would not try to move back, the previous configuration would not have been stable, as discussed above).
In conclusion, the root cause of elasticity is that the material was stable in the first place!
A: The bonds between atoms will 'break' if they are pulled apart even a short distance; however, the angles between adjacent bonds can be distorted a fair amount.  If the molecules have a zigzag chain structure, or better yet a helical chain structure, you can stretch the material more without breaking the bonds.  If the chains are anchored near the ends (cross-linked) then the network can restore its original shape and the material is 'elastic'.
