This question seems to turn up reasonably regularly in various forums, so I thought its worthwhile investigating.
A jpg file contains various records; Photoshop uses a record called Photoshop IRB resource, located in the APP13 record. It begins with the HEX string 0xFF 0xED, followed by the segment size, the “Photoshop 3.0\x00“ identification string and then a collection of segments marked by the string “8BIM”. I won’t go into the details but the interested reader will find a wealth of information with a google search.
Adobe is moving toward storing the metadata as XMP data. XMP is a form of XML and is easily read with a text editor.
Adobe Bridge and Lightroom store the metadata as an XMP file, either as a sidecar or imbedded in the image but do not write the legacy IRB resource. Applications and web sites that can only read the IRB resource data don’t display the IPTC information.
Photoshop writes the legacy IRB resource as well as appending the XMP Metadata to the end of the image data so an image saved from Photoshop will have both the new XMP metadata and the Legacy IRB resource. The disadvantage of this method is a slight image degradation as the jpg is uncompressed, displayed in photoshop and then recompressed.
Timothy Armes’ LR/Mogrify Lightroom plugin uses exiftool to write the legacy IRB resource block into the images that it outputs without altering the jpg data block. This allows the metadata can be read by those applications that have not been updated to read the new XMP data.