Exactly. iOS 12 was released in 2018 and received its final security update last August. So if Apple does the same with iOS 15 we should get another 3 years of security update.
So, the phone will basically continue working as-is, and will still be secure. The newer versions of iOS are a mixed bag anyway. The biggest problem in practice will be the apps eventually dropping support for the old iOS version. It won't happen overnight though.