Average overhead for a hospital based doc is 100K.  Even if they have an office and secretary inside a hospital they have to pay for it.  Only nurses and hospital administrators get office space and support staff for free.

There are efforts now to redistribute income from higher paid specialists to lower paid GPs.

The hours worked are also very different.  Hospital based specialists provide care 24/7.