"Would correcting PF reduce line losses?"
Yes. Example: If you have a large motor with a 0.80 pf and you correct pf to say 0.98 you will have a reduction in the current flow and thus decrease line losses up to the motor.

"So in theory, If I was to correct at the subpanel, this would reduce losses from the main to the subpanel?
Yes

"And If I correct at the main, this would reduce losses from the substation to the main."
Yes

"Is that why you try to correct as close to the load as possible, if installation costs permit such a design?"
Yes. The capacitor size is dependent on the size of the motor. You need to contact mfg for a suggested size.

"This leads to the obvious question of why don't equipment manufacturer install PF correction right on their equipment as a standard feature?"
Cost. All costomers are not charged for a low PF and thus no need to correct it.