John Gill uses these sources:
Jarchi says, it was the custom of the Amorites, when anyone died, to
cut their flesh, as it was of the Scythians, as Herodotus relates,
even those of the royal family; for a king they cut off a part of the
ear, shaved the hair round about, cut the arms about, wounded the
forehead and nose, and transfixed the left hand with arrows; and so
the Carthaginians, who might receive it from the Phoenicians, being a
colony of theirs, used to tear their hair and mouths in mourning, and
beat their breasts; and with the Romans the women used to tear
their cheeks in such a manner that it was forbid by the law of the
twelve tables, which some have thought was taken from hence: and all
this was done to appease the infernal deities, and to give them
satisfaction for the deceased, and to make them propitious to them, as
Varro affirms; and here it is said to be made "for the soul", for
the soul of the departed, to the honour of it, and for its good,
though the word is often used for a dead body: now, according to the
Jewish canons, whosoever made but one cutting for a dead person was
guilty, and to be scourged; and he that made one for five dead men, or
five cuttings for one dead man, was obliged to scourging for everyone
of them: nor print any marks upon you; Aben Ezra observes, there are
some that say this is in connection with the preceding clause, for
there were who marked their bodies with a known figure, by burning,
for the dead; and he adds, and there are to this day such, who are
marked in their youth in their faces, that they may be known; these
prints or marks were made with ink or black lead, or, however, the
incisions in the flesh were filled up therewith; but this was usually
done as an idolatrous practice; so says Ben Gersom, this was the
custom of the Gentiles in ancient times, to imprint upon themselves
the mark of an idol, to show that they were his servants.
You may trace the links through the reference.
Ketovet Ka'aka
is a hapax legomenon (only occurs once).