An antagonist is a classification used to describe a muscle that acts in opposition to the specific movement generated by the agonist and is responsible for returning a limb to its initial position.
Antagonistic pairs are needed in the body because muscles can only exert a pulling force, and can't push themselves back into their original positions. An example of this kind of muscle pairing is like the biceps and triceps. When the biceps are contracting, the triceps are relaxed, and are able to be stretched back to its original position. This is the opposite when the triceps are contracting.
The Rectus Femoris biarticular muscle acting over the hip, when compared to the hamstrings has a smaller hip movement arm. But, the rectus femoris movement arm is greater over the knee, than the hamstring's knee movement. This means that contraction from both rectus femoris and hamstrings will result in hip extension, and knee extension. Hip extension will also add a passive stretch component to the Rectus Femoris, and will result in a knee extension force. This "paradox" allows for efficient movement especially during gait.