For CS, BITS Pilani is better than IIT BHU. It offers excellent resources, infrastructure, academics, and placements for the branch. BITS is widely recognized in the CSE domain. The curriculum followed is probably the best among the technological institutes in the country.
The recent highlights of BITS Pilani placements show the median CTC for CSE to be around INR 18 LPA. While the highest CTC goes up to INR 40 LPA. All major MNCs visit the campus drive. If you can afford the course fee, you should go for BITS.
Before answering the question we must be well aware of the grounds on which we are seeking the comparison. They can be Placement statistics, college environment, abroad opportunities, co-curricular activities, fee structure, etc. After this, we will be able to draw a fair comparison.
As far as this question is concerned what we know is that both colleges have a fair reputation and stature. For the fee structure, IIT BHU has definitely an edge. If location is not a problem for you, as it happens with many, then BITS and BHU are on the same plane. Unlike other engineering institutes, BITS is the only institute in India without any reservation.
Despite the fact that both colleges have good placement records, IIT BHU has a great alumni base (which becomes crucial for placements). Although IIT BHU is not ranked on top in the NIRF ranking among IITs, the placement is one phenomenon where others also accept IIT BHU mettle. The 2019 NIRF ranking for IIT BHU was 28, while for BITS it was 39. The average salary at IIT BHU was 13.69 lakhs and 11.47 lakh for BITS for CSE. You can see how close the comparison is.
Both colleges are also known for extracurricular activities with name and fame all over the country. Probably the right way to find which college is better is to see the individual elements of the college like fee structure or placements and then decide what really matters to you.
Now, this answer may vary from person to person. If it is the IIT tag you are seeking, then you could go with it. If it is the legacy of BITS which attracts you, you can go with it as well.