Why does my iPhone photos show the places they were taken?

I noticed that if someone sends me a picture and I save it to my photo album it'll show where the location the picture was taken at.
Some of the pictures I take myself too will show the location in my album.
I'm wondering exactly why it does this lol

It's called Geotagging. When you take a photo it locates your location you took the photo and saves it to your picture. It's great for keeping in track where you took photos. In the Places tab on the Photo app on your iPhone it shows where you took that photo.