Your role is to publish papers so your PI is able to get grants, and to network, so the lab profile gets better known in the research community, and then as a more senior grad student you can help write grant applications, and you can build a track record of mentoring (e.g. master students). At the end of the day, you want to demonstrate that you can come up with projects and pursue the research up until publication in a top-tier venue, and the ultimate goal (from the point of view of hiring committees) is obtaining prestige and funding for the university.
If you plan to go to industry, your incentives are somewhat misaligned with your PI. In that case you want to pursue multiple internships and getting networked with top companies in your field, and demonstrating practical output, well-released code, demonstrated downstream value for followup projects etc.
That's not my experience -- there's a whole pretense about being experts in a field, which is exactly what the poster above bought into. Having a PhD doesn't make or prove you're an expert about anything. It just proves you know how to do research in a thing, but that doesn't stop us from presenting PhDs in front of juries as if they're the only ones who know what they're talking about.
I don't see how these are incompatible. The PhD prepares you to be an independent researcher. The way you prove this is by studying the same topics for a few years, and by the time you reach your viva, you'd be expected to know a lot about the topic you chose.
It's not incompatible, many people in order to do research have to gain a great expertise in a thing. Others can get a Ph.D. having really no expertise at all, but just the ability to get through a research program. Others still can be experts and unable to navigate a research program due to how capricious and political they are. So the pretense is that the Ph.D. is a marker of expertise. It's correlated with expertise, but the actual thing it signals is you've gotten through a research program.
If you plan to go to industry, your incentives are somewhat misaligned with your PI. In that case you want to pursue multiple internships and getting networked with top companies in your field, and demonstrating practical output, well-released code, demonstrated downstream value for followup projects etc.