It is all done this way to produce smooth movement.
Muscles work in pairs and sometimes in more than pairs (2) because it makes the movement smooth. The muscle that is making the move is called the prime mover while another is called the antagonist and it resists the move. It slowly “lets go”. This way the movement is not jerky.
There are often other muscles involved, especially if the joint is complex like the shoulder joint or the knee joint. There are also helpers of the prime mover which are called on when more force is needed.
Sometimes the joint will have to be held in place and muscles called fixators will have this job.