A groove is a ditch that became a metaphor. The word comes from Dutch groef meaning 'furrow' or 'ditch', from Proto-Germanic *grōbō — the same root that produced grave (a hole in the earth) and engrave (to cut lines into a surface).
The original English sense was craftsman's vocabulary: a groove was a channel cut into wood, stone, or metal. Joiners spoke of tongue-and-groove construction. Machinists cut grooves for gears and pulleys. The word stayed firmly physical for two centuries.
The figurative shift began in the 19th century. Being 'in a groove' meant following a fixed track — like a carriage wheel in a rut. The phrase could be positive (a productive routine) or negative (a rut you cannot escape). Context decided the tone.
The musical meaning emerged from jazz culture in the 1930s. Musicians said a tight, compelling rhythm had 'a groove' — the band was locked into a track as precisely as a phonograph needle in a vinyl record. Whether the metaphor came from the physical grooves of records or from the older 'settled routine' sense remains debated.
By the 1960s, groovy had become one of the decade's defining slang terms. A ditch-digger's word had become the highest compliment in counterculture vocabulary.