One is high tech, researching and manufacturing in “clean” labs. Carbon footprints are tiny by any measure. The other is dirty and environmentally unfriendly.
But they both make money from assets that have a limited life.
In the case of pharma, once their patents end, they face competition from generics. This affects their margins.
Miners and energy companies dig holes in the ground to extract minerals, and oil and gas respectively. The mines and fields too have limited lives.
Moral of the story: Always look below the surface when analysing. Don’t be fooled by superficial appearances.