torch.distributed.launch is a CLI tool that helps you create k copies of your training script (one on each process). And as you correctly pointed out it sets certain env vars that ddp uses to get information about rank, world size and so on. The closest analogy is what mpirun is to mpi applications. torch.distributed.launch compliments ddp by making it easy for you to run your ddp training script.
It is one way to launch ddp scripts but not the only way.