It depends on the camera. You can't compare an 8 year old, 3MP digital kodak, but 99.999999% of the time, a dedicated camera is always going to take better pictures than the camera on a phone.
Sensor and lens size are the main contributory factors. A phone has a small area to work with and it has to cram a tonne of other stuff in there for all it's other functions, but a camera, who's sole purpose is to take pictures has much more room for bigger lenses and sensors etc.
Whilst phone cameras have gotten very good, they're trying to do too many things at once to ever excel at one compared to something that is specifically designed for a single purpose.