Aside from existing when a level is started, Rock can be formed when Ooze comes into contact with Algae
Rock is Cut (Driller Challenge Only)
During the making of Where's My Water? 2, the developers wanted a distinct look for Swampy, Allie and Cranky levels. Having various shades of Rock depending on what alligator was in the level was just a part of that.