Some headphones are 'active', with amplifiers built into the cups and requiring a power source (typically AAA batteries).
I then see many audiophiles discussing frequency response as a metric of how good headphones are, and they categorically dismiss most 'active' headphones such as the Dre Beats Studio.
However, with some op amps it would seemingly be fairly easy to equalize the input signal, pre-amplified, such that it could completely correct for the driver's frequency response and thus produce an extremely flat frequency response if desired (or not, such as bass boost or cut).
Is there something particularly difficult with doing so?
For example, for the Dre Beats Studio (blue line), perhaps the EQ circuit could provide +3db@750Hz, -5dB@1100Hz, +6.5dB@1300Hz, +5dB@1550Hz, -4.5dB@8.5kHz, and +14dB@15kHz, with the slopes tuned to best align the frequency response to 0db from 500Hz to 20kHz.
Best Answer
When you put something to your ear reproducing standard stereo recordings, you don't want a flat frequency response because the head-related transfer function that normally comes into play for a sound source much further away looks very different when the source is against your ear.
Let me quote you a couple of paragraphs from a book:
This HRTF difference issue is also why angled drivers (in headphones) sound better to enough people that companies like Sennheiser sell such. Angled drivers don't fully make headphones sound like speakers though.
At factory or in a lab an artificial ear is used when measuring the frequency response. The one below is a lab-level one; the factory-level ones are a bit more simple.
I also found the methodology used by that HeadRoom site:
The microphone used is probably this one. It seems they actually invert the transfer function of the dummy head/ears via software because they say right before that that "Theoretically, this graph should be a flat line at 0dB."... but I'm not entirely sure what they do... because after that they say "A “natural sounding” headphone should be slightly higher in the bass (about 3 or 4 dB) between 40Hz and 500Hz." and "Headphones also need to be rolled-off in the highs to compensate for the drivers being so close to the ear; a gently sloping flat line from 1kHz to about 8-10dB down at 20kHz is about right." Which doesn't quite compile for me in relation to their previous statement about inverting/removing the HRTF.
Looking at some certificates that people got from the manufacturer (Sennheiser) for the headphone model (HD800) used in that HeadRoom example, it seems that HeadRoom displays the data without any assumed correction model for the headphone itself (which would explain why they give their later interpretation suggestions, so their initial "flat" suggestion is the misleading one), whereas Sennheiser uses DF (diffuse field) correction so their graphs look almost flat.
This is just a guess though, differences in measurement equipment (and/or between headphone samples) could well account for those differences since they aren't that big.
Anyway, this is an area of active and ongoing research (as you probably guessed from the last sentences quoted above about DF). There's quite a bit of this done by some HK researchers; I don't have (free) access to their AES papers, but some fairly extensive summaries can be read on the innerfidelity blog 2013, 2014 as well as following links from the main HK author's blog, Sean Olive; as shortcut, here are some free slides from their most recent (Nov 2015) presentation found there. This is quite a bit of material... I have only look at it briefly, but the theme seems to be that DF isn't good enough.
Here are a couple of interesting slides from one of their earlier presentations. First, the full frequency response (not truncated to 12KHz) of HD800 and on more clearly disclosed equipment:
And perhaps of most interest to the OP, the bassy sound of the Beats isn't all that appealing, granted in comparison with headphones that cost four to six times as much.