We've talked before about how difficult it can be to trace the lineage of a slang term. Not only is slang informal and, at least initially, confined to a particular group, but it also may not make its way into print until long after it is established in speech.
The difficulty of unearthing the truth is increased when a piece of slanguage is assumed to have a history more salacious than salubrious. Such is the case with today's term, balls to the wall. For the real story, you need to look to the skies.

It seems the handles controlling the throttle and the fuel mixture on airplanes are often topped with ball-shaped grips. Pushing those balls forward—as close as possible to the front wall of the cockpit—yields the very richest mixture of fuel and the highest possible speed. In other words, an all-out effort.

Although etymologists believe pilots have been talking about balls to the wall since the Korean War, the expression didn't appear in print until the 1960s. That gave amateur etymologists plenty of time think up an alternative explanation. According to one theory, the balls in balls to the wall name the round, metal weights at the end of the arms of an engine's speed governor. As the speed increases, these spinning balls rise, becoming perpendicular to the walls at maximum speed.

But perpendicular to the wall isn't the same as pushed to the wall, and this etymology offers no supporting evidence.