Every time we give the dogs a bite of scraps at the end of our meal, my basset immediately pees in the floor. Every time. We try to be fair and give her and our beagle the same size nibble. They are both seniors. 12 years old. I have researched everywhere and haven't found one thing about this problem. We have stopped giving her any bites, but I really want to understand why she is doing it. Does she think she is rewarding us?
Need more information for this. You mentioned that they are both seniors. May be a good idea to take them both into the vets to get a senior work up (bloods, urine and faecal matter testing). Could be a urinary infection or weak bladder at her age.
Is she pee a lot more now? She isn't doing it out of spite though. We tend to anthropomorphise dogs and compare what they do with human emotions. Dogs live in the present and don't sit up at night thinking of ways to "spite" us or "get back at us". She may be in a state of being conditioned to pee after she gets the treat (self rewarding behaviour), or without further context to what you do when giving her the treat or after giving her the treat (nervous peeing from fear of being yelled at), it's hard to say why this is happening.
I would strongly advise getting her checked out at the vet for a medical reason. For Behavioural problems, I always have the animal checked over by a vet first as it's simply the ethical thing to do.