Honestly I think all too oftern both are arbitrarily placed where they fit best over wher they work best by most exhaust shops. On my ImpalaSS I had the H pipe welded and removed 4 times until I had the best location. The best location for it proved to be a place not very accomodating to ground clearnace but still netted almost 6 RWHP more over the original location which best “fit” under the car.
I know professional race vehicles spend hours of dyno tuning and complicated math to find the “best” location for these balance tubes.