As @L3b said, there are a few different types of composers, and some are more comfortable with black keys than others. Some compose in an easy keyboard key and transpose, and some are comfortable in any key and would rather choose based on sound. I think most people who consider themselves piano players and compose a lot compose in the same keys they tend to play in, because that's what they are most practiced at and comfortable with.
Modes are also something to consider. A lot of music, especially pop, isn't just in major and minor. Mixolydian (major with a flat 7) is more popular than major or minor in a lot of genres that are derived from blues, so G is also a popular key. And there's a lot more out there in Lydian (major with a sharp 4) than most people realize.
If the composer composes most of their music for jazz bands with wind instruments, chances are most of it will be in B flat, E flat, F, G minor, F mixolydian, etc.
If the composer plays in a guitar-based rock band, they will probably use a lot of E, A, D, and G, and modes (major/minor/mixo) will not matter as much.
Still others, as has been mentioned already, are good keyboard players and feel better in keys that seem weird to non-keyboard-players like me (like C# major or Eb).
And, as @Jules said in the comments to this answer, some people prefer to use just the black keys, which is a pentatonic (5 note) scale.
I've met a number of composers (particularly in folk and vocal jazz) that do use C major and A minor almost exclusively to compose on keyboard and then transpose, so there are definitely those who prefer the white keys.
People also have different views on transposing. Some think it's heresy, and that changing the key of a song fundamentally changes the way you perceive it because of things like resonant frequency. Some (most) don't.
Basically, the way people compose is all of them.