The accelerometer* can detect movement as well (it's measuring acceleration after all!) but for detecting orientation you've got to rely on the acceleration due to gravity as a reference. And as both the X and Y axes are parallel to the screen (the X axis is horizontal when held portrait, Y axis is vertical) these both register zero when placed flat on a table and the Z axis (which is in/out of the screen, perpendicular to the X and Y axes) is always at minus one. There's a accelerometer graphing sample app in the SDK and I've tried this
You could rotate the device around a point offset from the accelerometer I guess and try and resolve that movement into rotation, but it's probably not going to be very accurate (and also depends on where exactly the sensors in the iPhone are!).
* I talk about it as one device, but it's technically a combination of 3 accelerometers on 3 axes





