To what extent do PhD students in computer science collaborate equally with other PhD students when working on a research project?
The PhD is generally awarded to students for their individual contributions to science. That's the whole point. It's not only about advancing science, but advancing science yourself. Otherwise, we would grant a new PhD to each member of a research team every time they had significant new results. Everyone is aware that it's possible to be more productive in teams, but the degree itself is really only about what you can add. So the encouragement to work on your own is there to make it easier to demonstrate what you have personally added to the body of knowledge in your area. Distinguishing your work from another student's could be very hard if you do everything together. This is the traditional view at the very least.

All this being said, discussions, brainstorming, help diagnosing problems should all be a part of students working with others (students, postdocs, researcher professionals, the supervisor, and other faculty). You just have to keep your work separate enough that you can make an easy case for yourself when it comes time to defend your dissertation.