Risk of any test case failure is determined by two factors:
1. Probability: It’s the likelihood of the scenario happening in prod or how often or what percentage of customers might hit that scenario. The higher this likelihood, the higher the probability.
2. Impact: It determines the effect to the customer/end user and/or company if the scenario is broken. The higher the impact, the higher the severity.
Probability + Impact = Risk
Any test case, whose failure falls under High Probability High Impact category (depicted as red in the above figure) should be a P1 test case.
Similarly any test case, whose failure falls under Low Probability Low Impact category (depicted as yellow in the above figure) should be a P3 test case.
Rest all scenarios should be marked as P2.
Now how you quantify probability and impact is a bit subjective and mostly based on intuition + feature awareness. But always think from end user perspective to ensure consistency.