The cable end is held into the HB lever on the brake caliper by a welded ball at the end of the cable, then the outer cable body is held in place by a sleeve and collar. This collar is at the end of the arm that is part of the main ally body of the brake piston housing.
Two problems arise, both due to lack of copper-slip.
1. The ball rusts in place and can difficult to free.... or
2. The collar seizes in place, I have seen plenty of folks snap off the ally arm/collar trying to free the cable sleeve end. Don't use heat as I've also seen someone use a blow torch to free things up and the seals then instantly gave way...... d'oh!
Clear as must of the crud off the collar and use mole grips / pipes grips that give plenty of purchase - just rotate the sleeve centrally. The sleeve ends do have fitting for a spanner but as the cable is knackered I generally use the mole grip method for extraction.
Clean everything up and use copper-slip on the refit its all very straightforward :-)