Interesting; to understand this, I reckon you need to look at the original meaning of quick:
alive" is the original meaning of quick. The quick and the dead did not refer to gunslingers in the Old American West, but instead refers to "the living and the dead" as in the Bible, Acts 10:42. The current meaning of quick, "rapid", did not emerge until the 13th century.
It's archaic, but "alive" was the original meaning of "quick".
Now, here comes the interesting part. The flesh under the nail is called quick because the nail, the hard part, is dead, but the flesh is "alive," thus the origin of "quick" as the flesh under the nail:
Some other words still in use today which carry the original meaning of quick include quicklime, literally "living lime", quicksand "living sand", and the noun quick ("the tender flesh under the fingernail or toenail"), referring to the living flesh beneath the dead nail.
Notice that 'quick" can refer to any body flesh as well:
the tender, sensitive flesh of the living body, especially that under the nails: nails bitten down to the quick.