When the terms "square up" or "squaring up" are used in basketball, they are in reference to the positioning of a player and the stance they are taking on. The term and idea is seen both on the offensive and defensive ends of the court. They square up on either the opposing player or the basketball hoop.
On offense, when a player is squared up, it is referencing the basketball hoop. It is an integral part of a basketball shot and when they shoot a player squares up to the hoop
There are two different stances a player can take in basketball: an open stance and a squared stance. The squared stance is what most kids are taught when they are learning the sport, as it is thought to be the more successful of the two.
A squared stance requires the shooter's feet to be pointing to the hoop, which in turn points (squares) the shooter's body up to the hoop. The process helps with the aim of the shot. Even when players are moving, when they rise up to shoot the square their body to the hoop to maintain accuracy.
Squaring up actually benefits parts of the offensive game other than shooting. When a player has the ball and is facing the hoop they have the greatest possible field of vision. That allows them to have the most options and potentially make the best pass available.
When squaring up on defense the reference point that the defender is facing isn't the hoop, but the player with the ball. Defenders position their bodies so that it is facing the offensive player, which makes their body larger and more difficult to get around. It also allows them to react to the ball handler's movements quicker.