Why does Saturn have both moons and rings?
You're right that density is the important thing here. The Roche limit is the distance from the main body $d$ such that
$$d=1.26R_M\left(\frac{\rho_M}{\rho_m}\right)^{\frac{1}{3}}$$
where $_M$ denotes the main body and $_m$ denotes the satellite.

As you can see from the chart on the Wikipedia page, Pandora and Prometheus are both at least one and a half times the Roche limit from Saturn. Therefore, they're in no danger of being ripped apart any time soon.