The Rif says that shein and regel are exempt for damages in a public domain because "it is normal" - meaning that the type of damage is not out of the ordinary. The Rosh is bothered with why the Rif feels compelled to offer a rationale for the exemption in public domain, it is just a gezeiras hakasuv that the gemara learns on 21b that shein and regel are only chayev in reshus hayachid. The Rosh explains that the Rif is coming to explain the Torah's exemption, since it is normal for them to go in the public domain and damage by just normal activities, it is impossible for the owner to watch them and prevent these types of damage. Therefore, if there is a beam half in the public domain and half in the private domain, and the animal steps on the beam in the public domain which causes damage to vessels in the private domain, the owner is exempt. Had it just been for a pasuk the owner would be liable since the damage occured in a private domain, but since the rationale for exempting in reshus harabim is because the animal has a right to walk there freely, the owner is even exempt for damages that are caused in a private domain from the animal that is in the public domain.
The Yam Shel Shlomo offers a simpler understanding of the Rif. The Rif is not coming to be mechadesh halachos, rather just trying to help us categorize the different forms of damage. Anything which is normal qualifies as shein and regel which are exempt in reshus harabim. This idea is supported by the Nemukei Yosef 15b. The gemara says that if a dog eats large sheep that are not normal for a dog that size to eat, it qualifies as keren, but if they are small sheep then it qualifies as shein since it is normal. The Nimukei Yosef explains that anything which is abnormal is considered keren even if the animal is doing it for the pleasure of eating, and therefore the damage qualifies as a "penalty" which we don't have the power to collect outside of Israel. The Rif is also explaining that the primary characteristic of shein and regel is that they are normal, to the exclusion of anything which is abnormal automatically qualifies as keren rather than shein or regel.