Moving back and forth steadily, or performing exciting rock music, or doing something with impressive skill and style.
From Old English 'rocian' meaning to move back and forth. The musical meaning came later in the 1950s when 'rock and roll' emerged, and 'rocking' became slang for doing something excellently.
A mother rocking a baby and a rock band 'rocking out' use the exact same word root—but one describes calming motion and the other describes intense energy, showing how one simple motion concept became associated with both soothing and exciting uses.
Complete word intelligence in one call. Free tier — 50 lookups/day.