Random assignment can increase external validity, but it has a bigger impact on internal validity.
Random assignment helps to reduce confounding variables and ensures that the treatment and control groups are comparable in all aspects except for the independent variable.
This increases the confidence that any observed differences between the groups can be attributed to the treatment rather than other factors, which means an increase in internal validity.
It can also improve external validity because random assignment of participants prevents researchers from inadvertently selecting participants who may be more or less likely to respond to the treatment.
However, the external validity may still be limited by sampling bias if the participants are not representative of the target population, which is why choosing the appropriate sampling method is also important to ensure external validity.
A probability sampling method, such as simple random sampling, stratified sampling, cluster sampling, or systematic sampling, is always the best choice.