The system is called Cellular Automata, sort of like that Game of Life thing, only instead of each pixel moving/cloning/despawning based on its surrounding pixels, it moves to a new position on the grid based on its surrounding pixels and its material type. There was a really good tutorial about it:
From there it just makes colliders and buoyancy areas based on the pixels so that the ball and fish can bounce and float :)