Let me refer you to the PIC 16F689 datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/41262E.pdfThe SPI interface can be used to both read and write program and EEROM memories. Code memory is under flag protection; if this was not set when the PIC was programmed, you can read it like any other memory. It is very handy to read program memory, edit it, and write it back.
Microchip really dropped the ball on microprocessors - they had the field to themselves, but made the cost of entry way to high for individual users. Expensive development systems, expensive compilers, etc. All the things Arduino did right.
Robert