1580s, "stupid person, blockhead, dunce, numbskull," perhaps from dialectal logger "heavy block of wood" + head (n.). Later it meant a type of thick-headed iron tool (1680s), a type of cannon shot, a post in the stern of a whale-boat, and a type of turtle (1650s). Loggerheads "fighting, fisticuffs" is from 1670s, but the exact notion in the compound is uncertain, perhaps it suggests the heavy tool used as a weapon. The phrase at loggerheads "in disagreement" is first recorded 1670s.
[W]e three loggerheads be: a sentence frequently written under two heads, and the reader by repeating it makes himself the third. [Grose, "Dictionary of the Vulgar Tongue," 1785]