Restriction endonuclease (EcoRI) inspects length of DNA and recognises specific palindromic nucleotide sequence, binds with DNA, cuts each of the two strands of double helix at specific points.
Detailed Answer :
This leaves the single stranded overhanging stretches at the ends. They are called sticky ends. They form H-bonds with their complementary cut counterparts. This stickiness facilitates action of DNA ligase, when cut by the same restriction enzyme the resultant DNA fragments have the same kind of sticky ends and these are joined together by DNA ligase.