The story takes place after a major upset does occur. Something happens in Country A which causes an economic collapse. The cost of a slave becomes less than the cost of feeding and housing them. Work becomes scarce, the black market in human souls explodes as desperate people resort to desperate measures. Country B closes its borders to all except officials and slave-traders.
This is all background. The story I'm developing starts when my main character and her husband sell themselves into slavery to Country B so that their children can be raised by citizens, as citizens. But first I need the background to make sense.
I need two things. One, is a reason for the original gradual shift for Country A. And two, is a reason for the economic crisis. I don't really have a head for economics, and Google has been helpfully directing me to a multitude of articles on the American Civil War and abolishionism in general instead of anything I can use for this.
For the gradual shift, I had initally thought it could be because of something similar to the Industrial Revolution, but I realized that that would trend more explosive than gradual. And for the crisis, it kinda seems like it would have the opposite effect. Not something that would really fit for the story.
Search terms: Economics of slavery, ending slavery -america, driving societal change, how societies change, economy slave society, industrial revolution, economics of industrial revolution
EDIT: Okay, so it looks like my best bet would be the mechanisation of cereal crops followed by a blight of those same crops, with other complicating factors as needed.
Thank you for all your help! Though, I'll still be looking at other suggestions, so feel free to keep contributing if you want!