Before that though, Samuel dies. This is handled in one single verse. You might suppose that a prophet important enough to have not one, but two, books in the Bible (in fact, the very first example of two or more books) would have his death addressed with a bit more than one measly verse.
Fortunately for Samuel's inclusion in his own eponymous books, he'll be back. Anyway, he dies and is mourned.
And then David moves to a new place and encounters Nabal, who is quite wealthy and miserly. Note that the later lessons from Jesus about the evils of wealth and wealthy people are not really new to the New Testament. There is very little in the Bible that is approving of wealth and the wealthy. Something that is virtually completely ignored by most modern churches, and inverted by the preachers of the Prosperity Gospel.
At any rate, it is shearing time, and like most people back then Nabal's wealth is largely tied up in livestock. David and his men guard the shearers and they're virtuous and steal nothing at all.
However we discover that David is a Nice Guy.
Nice Guys are a men who, for a variety of reasons including simple shyness, have the idea that a) sex and romance are transactional, and b) therefore they can get sex/romance by being "nice" to women. Scare quotes around nice because they aren't really being nice, what they're doing can be more accurately described as attempting to purchase sex and/or romance from a woman by pretending to be her friend.
What makes Nice Guys not so nice is that they have the expectation that by being "nice" they deserve sex, and that there must be something wrong with women who don't just hop into the sack with them after they've been so "nice".
Note that, quite often, the Nice Guy never actually mentions to the woman he's interested in that he'd like a romantic relationship with her, and will often later be quite venomous about being "friendzoned" even though he never, not once, told the woman he wanted to be in a romantic relationship.
Nice Guys often evolve, or perhaps devolve, into Pick Up Artists and become convinced that the secret to getting sex is to be a total asshole. Like the Pick Up Artists they often become, Nice Guys are convinced that women are basically without agency and that by doing X, Y, and Z they are simply entitled to attention and sex from women.
David exhibits similar behavior here. Nabal didn't ask for David to hang around his shearing team, and apparently Nabal was completely unaware that David had even been around until David sent a messenger to his house telling him so.
Having rendered his service, entirely unrequested, David now requests payment.
6 [...] Peace be both to thee, and peace be to thine house, and peace be unto all that thou hast.
7 And now I have heard that thou hast shearers: now thy shepherds which were with us, we hurt them not, neither was there ought missing unto them, all the while they were in Carmel.
8 Ask thy young men, and they will shew thee. Wherefore let the young men find favour in thine eyes: for we come in a good day: give, I pray thee, whatsoever cometh to thine hand unto thy servants, and to thy son David. (1 Samuel 25:6-8, KJV)
And Nabal refuses, he sends out messengers of his own telling David that he doesn't know who he is or why he's hanging around, but he didn't ask for his help and he sees no reason to give him anything. To be sure, he is rather curt, rude, and abrupt in his dismissal of David's request/demand.
David's response is, much like a Nice Guy who goes on a spittle filled rant about the evils of women and how they only like jerks and he never gets any despite being so Nice and always being there for the woman, an example of misplaced and odd rage.
I'll sidetrack briefly here and mention that we have another great example of why the KJV is often more entertaining to read than the NIV. The NIV translates that last bit as "if by morning I leave alive one male of all who belong to him!" I think "any that pisseth against the wall" has a more evocative ring to it.
21 Now David had said, Surely in vain have I kept all that this fellow hath in the wilderness, so that nothing was missed of all that pertained unto him: and he hath requited me evil for good.
22 So and more also do God unto the enemies of David, if I leave of all that pertain to him by the morning light any that pisseth against the wall. (1 Samuel 25:21-22, KJV)
The point is that David, snubbed in his demand for payment for a completely unrequested service, is outraged. So outraged that, in that lovely Biblical style of punishing a group of innocent people for a sin committed by a single person, he swears to kill every man in Nabal's household. Presumably they'd have then taken the women as sex slaves, that is what typically follows a Biblical slaughter.
But Nabal's wife Abagail gives David a present, David realizes that perhaps swearing to kill all the men in Nabal's household was a mite rash, and they leave. Then Abagail gives her husband a heart attack (literally) by telling him he came this close to being slaughtered by David, and once Nabal is dead David asks her to marry him. To the victor go the spoils I suppose.