Rarity means that the card is difficult to source (i.e., few copies exist), but this does not necessarily mean that it will be valuable. Scarcity means that the card is not available in sufficient quantities to meet demand.
The most valuable cards in this hobby are both rare (i.e., with few available copies) and scarce (i.e., the few available copies are not sufficient to meet demand). These would be trophies and prize cards, art academies and illustration contest promos, etc.
Then there’s the whole conversation about artificial scarcity in grading (i.e., low pop PSA 10s such as Base Set 1st Ed Chansey, Neo Genesis Lugia, Latias , Leafeon Lv.X., etc.). These are not rare cards per se, but they are scarce due to factory imperfections.