Apple provides two mechanisms to address these issues: iCloud Photo Library and My Photo Stream. My Photo Stream has existed since iOS 6.0 and iCloud Photo Library was introduced with iOS 8.1. The current version of iOS is 10.x, so these capabilities have been available for quite some time.
Although both mechanisms can be used, there are some important differences between the two that is important to understand.
Both mechanisms when properly configured automatically upload your photos to iCloud (Apple’s cloud storage offering) and synchronize the photos across properly configured iPhones, iPads, iPod touches, Macs, Windows PCs, and Apple TVs (4th generation). Synchronization means that a photo taken on one device will automatically appear on all the other devices; similarly a photo deleted on one device will be deleted on all devices. Any photos deleted can be recovered from a Recently Deleted album for 30 days. For all of this to work, iCloud has to be on all your devices and all the devices must be signed into iCloud with the same Apple ID. Photos are synchronized from your iOS device when your device connects to Wi-Fi and your battery is charged and you have at least 300MB of free disk space.
Now for the differences. With My Photo Stream photos only the last 30 days of photos are stored and you can have no more than 1,000 photos. The storage used for My Photo Stream is not part of your iCloud storage. Photos downloaded to your iPhone, iPad, and iPod touch are in a smaller device-optimized resolution, but on your Mac or PC are in full resolution. Any edits you make won’t be updated across all your devices.
iCloud Photo Library adds synchronization for Apple Watch and also includes the same mechanism for videos. It uses iCloud storage and as long as you have enough available storage in iCloud will store as many photos and videos as you like. The default is to store them at full-resolution, but there is an option called Optimize Storage to save space on your device by storing lower resolution copies. Edits are updated across all devices. When iCloud Photo Library is enabled, the photos and videos are not included in your iCloud backup. If you want to keep extra copies, they can be downloaded from iCloud.com or copied by attaching your iOS device to your computer with the lightening cable (the cable you use to recharge your device).
When you first sign up for iCloud, you get 5GB of free storage. If you need more storage, you can buy extra starting at $0.99 a month for 50GB, $2.99 a month for 200GB, or $9.99 a month for 1TB (1000GB).
If you are going to take photos and videos that you care about on Apple devices, then it is crucial that you understand how they are managed. Similar mechanisms exist for Android devices, but that is a topic for another day.