There is strength in numbers. Going somewhere with someone is pretty much an automatic deterrent to assault.
While an assailant might take on one person on their own, they’re going to be reluctant to face two or more.
It’s important that you stay with your friends, and not let someone separate and isolate you. It’s then that you’re in danger, and your assailant doesn’t have to worry about anyone interceding on your behalf.
If you look out for your buddy, your buddy will be looking out for you.