Why does headphones FR graph not look neutral like a straight line like output of devices? Why is the high end have lots of peaks?
Headphone FR graph represents the response of the transducer. Most transducers can't reproduce the whole spectrum of frequencies equally well (physical limitations). For instance, lower frequencies need bigger transducer size (woofers and subwoofers are big), and high frequencies need a smaller size (tweeters are small), but headphones try to balance it all with a single transducer, so an 'unbalanced' FR comes as a tradeoff.
Secondly, a speaker/headphone is an electrical system that produces physical oscillations, and based on the frequency of the input signal, the speaker/headphones' physical and electrical characteristics vary and affect each other.
Regarding the high end peaks and valleys, its because measuring the FR simulates the human ear, and High Frequency sounds tend to have a shorter wavelength and can be easily affected by interference due to reflection in the ear canal.
Also, some headphone makers 'tune' the high frequencies to sound more pleasant.
What if it was a complete straight line? Is that neutral?
From a headphone's perspective, yes.
From a listener's perspective, there might be slight adjustment needed, because of the
Equal Loudness Contour.
Basically, what this means is that in order for us to perceive two different frequencies as equally loud, their intensity need not be equal.
However, a 'flat' headphone will respond well to an EQ, and is a better candidate for sounding completely neutral.