Images sent over messaging apps are compressed before being delivered. This makes messsages faster to send, but comes at a cost of visual fidelity.
iMessage has the highest image quality, with HEIF encoding at size similiar to Discord’s JPEG encoding.
One caveat with iMessage is that if you share a 48MP RAW image, iMessage will downsize the image to 12MP before sharing.
iMessage has the highest video quality, using HEVC encoding at 720p video, but the framerate is dropped to 30fps. Any panning shot becomes noticibly choppy with the loss of framerate.
Vidoes shared via WhatsApp and Instagram are almost unusable because of the compression.
If you care about image or video quality, don’t use messaging apps for sharing. Use methods that preserve full quality, like AirDrop or an iCloud Link.