When you take a photo on a device that has photo stream turned on, that photo is added to the local photo stream group and uploads to icloud's servers, which then download the pics to other devices where they are also stored in their photo stream group. After 30 days, the photo is deleted from the server, but not the devices. (No more than 1000 pics are accepted, after which old ones are delete to make room for new ones.)
If, however, you turn off photo stream on one device, the photos in the photo stream group will be deleted. If you later turn it back on, then only photos on the server will download to the group. Pictures that were deleted from the server due to the 30 day rule will no longer be available.
It is advised that whenever you have photos appearing in the photo stream group, you move them to a permanent album if you wish to save them.
In short, photo stream is a conduit for copying photos from one device/computer to another - never treat it as some kind of permanent storage service; it isn't.