The matter really is complex, and these things changed over time, as well as between classes of slaves.
Legal theory assumed (and reality often bore out) that slaves were acquired during war. The word "servus" was (speciously) derived from servare, to spare, meaning those you had the right to kill, but spared and thus owned.
However, even the earliest Roman law code we have makes mention of the sale into slavery of dependents and possibly (depending on your interpretation) of debtors.
We have literally no useable data for the Roman kingdom and early Republic, but the going assumption is that slaves were mostly acquired through warfare and in small numbers, because it is hard to see how else it should have worked.
For the late Republic and very early Principate, the sources are very clear: warfare was the primary source of slaves, with the supply so large that slave-based agriculture became a viable business model even for staple crops. Landowners in Italy purchased slaves as investment goods and resold them as their value dropped. The wars of the late Republic were incredibly destructive and produced a glut of slave labour, often with the populations of entire cities being sold off. in addition, piracy and robbery also provided a steady source of slaves (the mart in Delos was infamous for that) Even then, though, the most prized slaves were not captives, but vernae, the houseborn. The highest prices were realised for people with skills in great demand, or the extraordinarily beautiful, who were often captured in war, but houseborn commanded a premium on captives of comparable accomplishments.
Incidentally, it is likely that even in the late republic, highly skilled slaves were increasingly trained from childhood rather than bought after capture. The stream of slaves kept up, but there were not that many Gauls, Raetians and Illyrians who could play the hydraulis, teach Homeric recitation or treat diseases.
By the principate, we have ample sources, but still no statistics. The most likely assumption IMO is that, following the mass enslavements of the Republic'as wars of conquest, the primary source of slaves was the slave population. Slavery was hereditary through the mother. We have records of self-sale and the sale of children, but the frequency of these cases is likely exaggerated. Wars still produced large numbers of captives, but these were rarer events now. Towards the end, the Republic had fought major campaigns almost annually, while the Principate could expect to go to war every few decades). Though piracy and border conflict still provided slaves to the market, the numbers cannot have been that considerable given the much reduced instensity of both. One source that grew in importance was import: slaves were purchased beyond Rome's borders and brought into the Empire. This was done especially with eunuchs, since castration was unlawful, but slavers also continued to purchase regular captives from the tribal wars of Germania or Arabia. We have records of legal enslavement as a result of sentencing, and of illegal enslavement through brobery of officials or by brute force, too. The papyri and literature frequently mention exposed infants being taken in and raised as family slaves, a phenomenon that was very likely quite common. The most plausible model is, though, that the majority of the (slowly declining) slave population were born to their status in most years, and the influx of captives during major wars became the main source occasionally. Exposed infants would in most cases also have become slaves. numbers are hard to estimate here.
In the later Empire, captives began to play a larger role again, but the numbers were much smaller. This is also a time for which we have almost no way of estimating any kind of percentage of slaves in the population. we know they existed, that is it. Imports played a greater role in the eighth and ninth century, when both Roman and Arab buyers purchased Slav slaves from Frankish, Viking and Avar or Magyar traders. The scale of this operation is hard to estimate, but may have been very considerable indeed. Since we lack hard data on child exposure, births to the slave population, or the number of people enslaved in war, though, it is hard to say wehjether it was the primary source. I rather suspect it was not, but others have regarded the Roman Empire after the Arab conquest as a society where slavery was as insignificant as e.g. medieval Italy, in which case imports could well have been the main source.