Stretching and light cardio will raise the temperature in your muscles and soft tissue gradually, making you less prone to injury, particularly around your joints.
There is some debate as to how effective warming up and cooling down are in terms of preventing injury, but most scientific studies show that it does have a positive effect. For instance, numerous studies and journal articles that provide evidence in favor of warming up to prevent injury.
However, it’s important to target the right muscle groups that will be used during the upcoming exercise; i.e. If you are training legs I would recommend you stretching off your hips flexers and lower back as the hamstring have a significant effect on your lower back muscles,,(lumber regions).