There are aesthetics parameters that Canon undistortion software wants to serve, part of it is for things like beauty photography/portraits, and to try and keep framing and distributing things so that you don’t end up with underscan in your frame.
The general idea of undistortion for CG though is solely lens based, otherwise undistorting a plate when the shot has a moving camera and objects in it are at different distances over time would be impossible withouth a camera beacon and a lidar scan of the set/environment 
Barrelling/pinching is due to the curvature of the lens, which with a constant surface size and film back gives you a direct relationship to focal length, and that’s is what ends up being used as a metre since it comes in convenient and digestible numbers.
That’s also why different filmbacks, sizes, gates and all make focal lengths look so different between different types of camera. It’s a combination of those factors determining how curved the lens will need to be (and hence the distortion it will cause), not just the focal.
For a 18mm length to fully cover a 35mm gate set to a certain distance from the mount the lens will be curved a certain way (very curved, fish-eye in standard 35mm SLR), but if you change that to a much larger area with a gate set practically level with the mount, 18mm can accomodate a much flatter lens which will distort less.