Nerd is defined as an unstylish, unattractive, or socially inept person; especially : one slavishly devoted to intellectual or academic pursuits. (Merriam Webster) The first documented appearance of the word nerd is as the name of a creature in Dr. Seuss's book If I Ran the Zoo (1950).
Dork is defined as a socially awkward or inept person (Merriam Webster), and currently used as a synonym for nerd. However, Merriam-Webster states that Dork is a variation on Dick, which is a variation on Prick. Both Prick and Dick are defined as "a spiteful man." Ex. The captain is a real prick/dick. So in its early use, dork would have referred to someone who's a prick (a spiteful man).
How did dork as a "a spiteful man" become a synonym for nerd, someone "slavishly devoted to intellectual or academic pursuits?" Is there a common linguistic process at work here?