There are many factors at play here:
- Your skills/experience
- The competitions skills/experience
- Current Market for your role
- The regional culture
- The Vibe
Going through them one-by-one, the more experience/skills you have, the better you can negotiate. This is a no-brainer. However, tangentially related to this is how well you sell your skills and experience. There's quite a bit of research here that indicates there is a gender divide between this. Women will apply for jobs they feel they are 90% qualified for, Men will apply for jobs they are 50% qualified for. I know that I've put 'over 1 years experience' for systems that I've logged into once or twice (to be fair, I do legitimately have multiple years experience on similar systems) - it may be that you aren't selling yourself very well.
Next up is your competition - unfortunately, there's no way to know this - sometimes you aren't the best candidate for the job and so your ability to negotiate is limited. If person A is a better fit and asking for XXX, Person B is good enough and they offer YYY, if Person B demands XXX, then they will go with Person A.
The current market is also a key factor - the more in-demand your job is, the more leverage you have. A desperate business is more likely to open the purse strings, whereas one who knows that they just have to wait 5 minutes for the next person to waltz through the door is less inclined to do so.
In addition to the current market in terms of demand, you also need to have a good finger on the pulse of what the current Market rate is. If for your area, the 75th percentile salary is say $100,000/yr and you go in asking for $130,000 - you are probably out of luck. Whereas if the 50th percentile salary is $125,000 and you ask for $135,000 - you are much more likely to be in the game.
Something I've personally noticed when it comes to ladies negotiating unsuccessfully is that they start too high, trying to be too aggressive and 'Boss B..tch', imitating how they think men negotiate - without an appreciation for the nuance.
Regional culture - Some cultures haggling/bartering/negotiating is very much the done thing. Other cultures see it as a sign of rudeness or disrespect. A lot of the info online about negotiating Salary is based on the English-speaking countries, where it is generally considered an accepted part of the process.
The Vibe - the more they like you, the more likely they are to consider a negotiation. This sometimes can even outweigh the skills and experience element. If you have one candidate who is slightly less qualified but they they feel like they would fit the team dynamic better, this can be the critical factor that allows you to negotiate.
Finally - and I left this off the list - is Confidence.
And the line between Confidence and Arrogance is much thinner than you might appreciate. What I've personally experienced (this includes coaching some ladies) is that Women lack the confidence of Men, so they try to overcompensate, but this comes across as Arrogance. Especially if you don't have a lot of experience negotiating successfully.
However - all this said - don't be disheartened. It took me at least 3-4 major jobs and a good number of missteps along the way before I had the skills and experience to negotiate my Salary. Before I do so, I will look at the market, the going rate, look at the company and come in saying 'Well, the average in this market for this position is X, but given I have Y experience that will be a significant asset to your company, I think X+15% is reasonable'.
Breaking it down - the first step is to let the party you are negotiating with know that you know what the market rate is, you've done your research and can't be BS'd. Next is to state the one key reason why they should want you (at your higher rate) than an average candidate and finally +15% on what the average is - it's in the right ballpark, it's reasonable and it gives you room to move down to the average +10% which is realistically where you want to be.