Some quality is compromised when an image is converted to a JPG. The reason is because the compression is lossy, which means that certain unnecessary information is permanently deleted. A JPG does, however, allow you to create smaller file size than you could with a PNG.
JPEG and PNG both are a type of image format to store images. JPEG uses lossy compression algorithm and image may lost some of its data whereas PNG uses lossless compression algorithm and no image data loss is present in PNG format