The most common reason why an iPhone randomly deletes photos is to free up storage space. Depending on your iCloud settings, your iPhone will delete local copies of photos already uploaded to the cloud as it hits a certain storage limit.