If you access the camera from the Lock Screen and then return to the Lock Screen without closing the camera app, the app will not continue running in the background. This can be confirmed by the absence of the green dot, which indicates that the camera is no longer active.
When your iPhone is unlocked, you have the ability to switch between different apps seamlessly. This means that you can move from one application to another without any restrictions. However, when your iPhone is locked, this functionality is disabled for security and privacy reasons. In this state, you cannot access or switch between apps until you unlock your device using your passcode, Face ID, or Touch ID. This restriction ensures that your personal information and running applications remain secure while your phone is not in use.
In summary, the camera will run in the background only when the screen is unlocked. Even in this situation, the green dot indicating camera usage will go away when the camera app is switched to another app using the App Switcher feature.