These were applied to prevent staff from stealing stamps and selling them.
In the 19th. century, the GPO would accept surplus stamps and pay cash. To prevent clerks from stealing the stamps and selling them to the post office, companies were allowed to mark them (perfins, underprints, overprints). The post office would accept the use, but not buy them back.
From 1881, stamps could be used as proof of payment of revenue tax. Consequently, companies held stock of stamps for that reason. Again, to prevent staff from stealing them, they overprinted them. The overprint did not invalidate them for revenue purposes.
The handwriting or date-stamping in rod's examples were added when revenue was collected by the company.
After the use of postage stamps for revenue purposes (1968) was abolished, some were used for paying postage.