Once upon a long time ago there was a Greek word graphein that meant write. When you wrote yourself that was an autograph, when you wrote on something that was an epigraph, when you wrote about prostitutes it was pornography and when you wrote beautifully it was calligraphy (presumably if you wrote about beautiful prostitutes it would be callipornography).
Anyway, the result of all these graphs was that the Latin word for a stylus (or sharp writing implement) was a graphium, and the result of that was the the Old French for a sharp instrument was graife. Therefore, when you cut off a shoot from a plant with a graife and attached it to another plant this was known as grafting.
None of which has anything to do with hard graft, which goes back to graft meaning dig, which goes back to graff meaning dig, which goes back to grave meaning dig, which is where we get the grave that was dug. Which leads inevitably to the question of what you call a man with a spade in his head.