Text messages are stored locally on our iPhones. This means that if they’re not backed up and something happens to our phone, we will lose them. If you have an iCloud backup then they should be saved and recoverable.