Diplomacy in the srd doesn't describe the mechanism for how the skill works, just that it changes NPC attitudes.
From the srd:
DIPLOMACY (CHA)
Check: You can change the attitudes of others  (nonplayer characters) with a successful Diplomacy check; see the Influencing NPC Attitudes sidebar, below, for basic DCs. In negotiations, participants roll opposed Diplomacy checks, and the winner gains the advantage. Opposed checks also resolve situations when two advocates or diplomats plead opposite cases in a hearing before a third party.
Action: Changing others’ attitudes with Diplomacy generally takes at least 1 full minute  (10 consecutive full-round actions). In some situations, this time requirement may greatly increase. A rushed Diplomacy check can be made as a full-round action, but you take a –10 penalty on the check.
Try Again: Optional, but not recommended because retries usually do not work.  Even if the initial Diplomacy check succeeds, the other character can be persuaded only so far, and a retry may do more harm than good. If the initial check fails, the other character has probably become more firmly committed to his position, and a retry is futile.
Special: A half-elf has a +2 racial bonus on Diplomacy checks.
If you have the Negotiator feat, you get a +2 bonus on Diplomacy checks.
Synergy: If you have 5 or more ranks in Bluff, Knowledge (nobility and royalty), or Sense Motive, you get a +2 bonus on Diplomacy checks.
INFLUENCING NPC ATTITUDES
Use the table below to determine the effectiveness of Diplomacy checks (or Charisma checks) made to influence the attitude of a nonplayer character, or wild empathy checks made to influence the attitude of an animal or magical beast.
Initial Attitude	————— New Attitude (DC to achieve)—————
 	Hostile	Unfriendly	Indifferent	Friendly	Helpful
Hostile	Less than 20	20	25	35	50
Unfriendly	Less than 5	5	15	25	40
Indifferent	—	Less than 1	1	15	30
Friendly	—	—	Less than 1	1	20
Helpful	—	—	—	Less than 1	1
Attitude 	Means 	Possible Actions
Hostile 	Will take risks to hurt you 	Attack, interfere, berate, flee
Unfriendly 	Wishes you ill 	Mislead, gossip, avoid, watch suspiciously, insult
Indifferent 	Doesn’t much care 	Socially expected interaction
Friendly 	Wishes you well 	Chat, advise, offer limited help, advocate
Helpful 	Will take risks to help you 	Protect, back up, heal, aid