The situation you are describing where muscles are situated on opposites sides of a joint and produce opposing movements is called "antagonism." Most joints are set up where one or more muscles on either sides will produce such movements (e.g., flexors vs. extensors). Here's a question about muscles without antagonists.
When you contract all the muscles crossing a joint (i.e., when you are "showing off"), the muscles balance each other. If not, the bones would move and the joint angles would change. So taking the elbow as an example, in the image below, Arnold is contracting the elbow flexors (biceps brachii, brachialis) as well as the elbow extensors (triceps brachii). In order for the bones to remain static, the forces must be equal and opposite.
!Arnold