Nerd as an insult basically means "you are smarter than me, and that makes me feel inferior so I must cover up my inadequacy by making fun of you". Also, a lot of people don't know this, but the term "nerd" was actually coined from Dr. Seuss. Yup, you heard me right.
Being smart is only part of being nerdy. A nerd is someone who is very smart and gets excellent grades in school, but also has no social skills and usually has very few, if any, friends. Nerds have low self esteem and low confidence in spite of their high intelligence and are usually physically out of shape, either skinny and weak or overweight.