This question comes from a game I've recently played. I was playing Lucio and I got nearly 13,000 healing and nearly 13 minutes on fire. However, at the end of the game, at the commendations screen, I got a "card" for my 4 environmental kills. Is there a certain system that prioritizes some stats over others or is it a case of luck concerning what comes up at the end-game screen?
Yes, there is a system for that. All cards available to your class first has to have its base requirements satisfied. Then they could potentially show up, depending on how the other players did in their respective categories.
Each card is scored and their individual score is also multiplied by a weight. As you noted environmental kills for instance is considered "very cool" so every score is multiplied by some hidden factor. Match on fire is a card that has to be over a certain level to show up (base requirements satisfied), but whenever it does it has a big score multiplier and this basically means that it is more or less guaranteed to be showcased in the end. In comparison, I have seen eliminations show up with very low numbers, so this would mean that it has a low base condition.
It's only 1 card per player, so to get the healing card when you have 4 environmental kills would probably mean having up around 15k healing (this is not real numbers, I'm just trying to explain how it works) for it to be "your best card".
At the end if not enough people has a "personal best card" that reaches a base score then fewer cards are shown. This is why we sometimes see only 3 cards, or fewer. I have never seen 1 or 0 cards but theoretically it could happen.
This is all speculating by the way, nobody except Blizzard themselves knows exactly how it work. This is just some things we can infer from observing how the system behaves.