Does the iPhone remember apps you’ve had previously ?

For example if I downaloded an app and deleted it would my iPhone know I previously downloaded and it will let me install instead of pressing “get”

*I got a new phone but it’s saying I already downloaded apps*