Modal logic was first developed to deal with these concepts, and only afterward was extended to others.
There are a number of different alethicmodalities: logical possibility is, perhaps, the weakest, since almost anything intelligible is logically possible: Possibly, pigs can fly, Elvis is still alive, and the atomic theory of matter is false.
Significantly, modal logics can be developed to accommodate most of these idioms; it is the fact of their common logical structure (the use of "intensional" or non-truth-functional sentential operators) that make them all varieties of the same thing.
Modal logic is most often used for talk of the so-called alethicmodalities: "it is necessarily the case that..." or "it is possibly the case that...." These (also called metaphysical modalities or subjunctive modalities) need to be distinguished from various similar-sounding claims using epistemic modalities.
The system most commonly used today is modal logic S5, which robustly answers the questions by adding axioms which make all modal truths necessary: for example, if it's possible that p, then it's necessarily possible that p, and if it's necessary that p it's also necessary that it's necessary.
Nevertheless, other systems of modal logic have been formulated, in part, because S5 may not be a good fit for every kind of metaphysical modality of interest to us.