It used to be called Pugilism and Pugilism is still the technical term. The word boxing originated when the first square ring was Incorporated sometime in the very early 1900's possibly even the late 1800's.
Before ropes were used the boxers used to fight in a crudely drawn circle on the ground, spectators would gather around the circle forming the barrier. When they decided that having betting spectators being able to interact with the fighters they decided to use ropes and since you cant have ropes make a circle they made the ring square and then people would say the fighters are boxed In.
Then the fighters were boxing.
The term also applies to the method of securing posts with ropes or somthing to that effect.