APM is the autopilot it means that have the control over the IMU and motors. It's the software that allows to stabilize the drone in the air. http://copter.ardupilot.com/
ROS is a framework to build distributed software for robots. With ROS you can retrieve information from sensors, send commands to actuators, program algorithms, etc. More info: http://wiki.ros.org/.
The relationship between ROS and APM, it's that you can control APM with ROS. For example, arm the vehicle via software, changes flight modes, setup a missión, read all the data from the sensors, etc