This notion goes back to Aristotle's argument about the sea battle, which is the seed of modal logic. He asserts the Law of the Excluded Middle and applies it to the notion of necessity. From a more modern point of view, this is a modal fallacy. Rules like "should implies can" and "is implies must be" choose a given form of the mode involved. Humans across languages and histories tend to conflate a complex of modes into four: Cardinal, Fixed, Mutable and Actual. But they don't really respect those divisions in detail.
There are plenty of Mutable modes, depending on what you consider 'possible'. You can see them warring in the history of the notion of omnipotence. God can do anything possible, so what is possible? Is the inconceivable possible? the inconsistent? things that are consistent with logic but not chemistry? Are there things that are conceivable to some other form of intelligence, but not ours? Are their better concepts what should determine the possible worlds?
This doesn't totally disappear in secular metaphysics. Modal realists like David Lewis need to deal with how one establishes possibility. If you choose something too strong, you are being childish. But if you accept the Cartesian notion of omnipotence, and absolutely anything is possible, you end up in a world of Menongianism and other horrors.
Necessity, then, in particular comes in a range of flavors (exactly one for every flavor of 'possible'). A couple of those have had currency over long periods, and serve metaphysical purposes. The traditional religious notion of necessity as contrasted with contingency, that goes along with the idea of essence is the most popular after Aristotle's. There are things that could have been otherwise, because they are accidental, and things that could never have been otherwise because they are essential.
A more modern flavor of this same approach is the interpretational framework of "many worlds" or of "evolutionary cosmology". In such a reality it makes little sense to choose a single timeline, "'brane" or instance of the universe as a perspective. What is necessary has to be what prevails across all worlds or timelines. It may be important to segregate the necessary things, like laws of physics, from accidental things like the mass of the universe. Determining what constants are necessary and what are symptomatic of our timeline is an important physical question. If you already accept Aristotle's non-contingent necessity as your model, you have to then create some kind of super-necessity to talk about these questions.
Another version of this is Boltzmann's notion of global entropy distribution, which he proposed to address Loschmidt's paradox, created by the observation of 'CPT symmetry'. He imagined that the we observe time as we do because we are in a low-entropy instance of the universe, where things are osmoticly moving toward higher entropy. In high-entropy universes, time should flow backward as entropy would naturally decrease. But at the same time, our memory is an exothermal process, so even if we were not really in a perfectly low-entropy environment, but a more intermediate one, we would remember only the most recent iteration of our timeline. Our memory would not evolve this way in a different environment, but that does not mean such environments don't exist. (Put cute: By the Anthropic Principle we are the efficient cause of the second law of thermodynamics.)
This gives an interpretation for "what is waving" in the wave-model of particles. In a low-but-not-extremely-low entropy environment, what is waving could be the evenness of the level of entropy. Even though entropy ends up giving us a global arrow of time, it could vacillate a bit first, as local entropy distributions that create local time rates catch up with one another.
In such a framework, the things that happened and then un-happened were temporarily real, so how can we then declare them necessarily otherwise. What is happening right now may not end up in the final timeline. So to declare its consequences necessary is premature.