During the first five Harry Potter books the Dementors were (notionally, at least) loyal to the Ministry of Magic. There's the odd occasion when they indulge their carnal desire to suck out the souls of innocents, like at the Quidditch match in Prisoner of Azkaban. But, by and large, they are obedient to their human masters.
In the last two books the Dementors switch their allegiance to Lord Voldemort. Dumbledore explains that the reason for this change in loyalties is that the Death Eaters can offer the Dementors much greater freedom to feast on human misery.
"Voldemort has returned," Dumbledore repeated. "If you accept that fact straight away, Fudge, and take the necessary measures, we may still be able to save the situation. The first and most essential step is to remove Azkaban from the control of the Dementors -"
"Preposterous!" shouted Fudge again. "Remove the Dementors! I'd be kicked out of office for suggesting it! Half of us only feel safe in our beds at night because we know the Dementors are standing guard in Azkaban!"
"The rest of us sleep less soundly in our beds, Cornelius, knowing that you have put Lord Voldemort's most dangerous supporters in the care of creatures who will join him the moment he asks them!" said Dumbledore. "They will not remain loyal to you, Fudge! Voldemort can offer them much more scope for their powers and their pleasures than you can! With the Dementors behind him, and his old supporters returned to him, you will be hard pressed to stop him regaining the sort of power he had thirteen years ago!"
(Goblet of Fire, Chapter 36, The Parting of the Ways).
Yet wouldn't the Dementors have greater scope for their powers and pleasures by operating as independent agents rather than as servants of Voldemort? They may have had greater independence under Voldemort to patrol Muggle areas freely, to breed relentlessly and to use the Dementors Kiss on innocents - things which they weren't allowed to do under the Ministry. But they were still slaves who had to obey the commands of humans. They were still used as the dog's bodies who guard the prisoners (albeit they were imprisoning Muggleborns rather than real criminals). They were still limited in who they could attack (since Voldemort greatly values wizarding blood and wouldn't permit the Dementors to carry out the Kiss on the majority of law-abiding wizards who weren't opposing him). They were still bossed around by people like Umbridge. They were still slaves.
What exactly did the Dementors get in return for serving Voldemort? Wouldn't they have been better off just acting as free agents, attacking whoever they wanted to and obeying nobody? Since all they seemed to really want in life was to spread despair and suck out the odd soul it seems to me that they could've fulfilled this desire more frequently if they stopped serving others and began serving themselves.
Why exactly were the Dementors motivated to serve either the Ministry or the Death Eaters, given that all of their human masters restricted their activities in one form or another?