There were a *ton* of laws about slavery in ancient Rome. The basic Roman position was that slavery was unnatural, so no one is naturally a slave, but slavery happens anyway because of human laws and actions. If you happened to be a slave, well that sucks for you, but there were laws about who could be a slave and why, what protections you had under the law, how you could be freed, your rights after your were freed, your descendants' rights, etc.
Normally in Rome slaves were soldiers and non-combatants captured in war. They were at war a lot so there was a pretty constant supply of slaves. Slaves were also generational. They could have families, and any children of slaves would also be slaves. They reproduced their own supply, basically. More rarely, free Roman citizens could voluntarily enslave themselves, to pay off a debt for example.
Slaves were property like any other kind of property, like a cow or a house. Legally a slave owner could do pretty much whatever they wanted to a slave, although socially they were expected to treat their slaves kindly, just as a decent thing to do (they shouldn't abuse their cattle either!). It was a crime for someone to injure/kill another person's slave, so they did have a tiny amount of legal protection.
Slaves could be freed by their owners, but then they were part of a special social class, freedmen (libertini), and they weren't full citizens. Since they didn't have full citizenship, it was possible to be re-enslaved. If a freedman disrespected his old master, or assaulted/injured him, they could be made a slave again. The law about that is kind of vague though, and probably most of the time, a freed slave always remained free. The special lesser status ended with them though - their children would be full free citizens.
There were so many laws about Roman slavery that there is also a gigantic book about it, "The Roman Law of Slavery" by W.W. Buckland. It's a very old book these days, and there are lots of newer books about Roman slavery too, but Buckland is...well, extremely thorough, at least.
You can also read English translations of a lot of Roman laws at the Roman Law Library (https://droitromain.univ-grenoble-alpes.fr/), including the updated compilations from the 6th century, which is where a lot of our knowledge of Roman law comes from.