Security issues can occur in both the device-agnostic Android OS code and in device-specific drivers. Some people are going to continue to use phones after the vendor drops support. Although those people won't get security updates to their device-specific drivers anymore no matter what they do, by using LineageOS instead of their stock ROM, they will get security updates to the device-agnostic Android OS code.