Its just timing, aim, and really knowing a map. UAV's also help a lot. If you zoom your map in and the commander has a UAV over you, you can predict exactly where the enemy is and just fire before you're even really in position.
Some players have a very good knowledge of the map they're on, and know the typical spots where people will be. Combine that with fast twitch reflexes and you'll end up doing very well.
I play with a terrible system by comparison to what some folks run BF2 on, all on low settings and the oldschool basic Microsoft optical mouse and I do that kind of stuff a lot. There's more to gaming than just pulling the trigger. You have to set your opponent up in situations where you have an advantage and when you can do that you'll be the one laughing while other people scream HAX!!!!111one~
As far as sniping headshots goes...I have expert sniper, and I headshot a whole lot. It's not easy though, make no mistake. It's well known that the models and their hitboxes aren't always synchronized, that's nothing new. But if you're firing at a stationary target you can get a headshot almost every time once you learn how each rifle acts. The grey puffs aren't uncommon and they're frustrating, but stick with it and you'll learn where to aim. Also, trying to headshot someone while they're running across your screen, not toward or away from you, is much harder. Surely not impossible, but the hitbox is more significantly out of line in that situation. When you're lined up with someone it may just be behind them and you'll get the headshot anyway, whereas someone running across your line of fire may have their hitbox behind them, resulting in the miss.