Difference between Rockwool and Acoustic Foam
Yes, as general concepts, both can be used for noise absorption but that doesn't mean they work the same way.  They can have potentially different absorption levels; different targeted frequencies; different form factors; different areas of use.

This page tallies up the absorption coefficients of hundreds of products: http://www.bobgolds.com/AbsorptionCoefficients.htm

Note how there are wildly differing values based on type, thickness, and even specific frequencies.  If you have a serious spike at 500Hz and only have 1" of space to work with and it's a curved area, then you'll want to find a material or product that is flexible and works well at that frequency.  Add in factors such as if the product will be visible or not; enclosed or not; and such, and you find a massive amount of variability.

So in the end, why are they both in the market?  Because they serve different specific purposes within the subset of acoustic control.