The phrase most likely originated as an aviation term, referring to the throttle levers of military aircraft (which have a rounded ball on top) being pushed to their maximum limit (i.e., to the bulkhead, or "wall").