Something that happens of necessity has to happen — it's unavoidable. During a blizzard your mother might, of necessity, serve leftovers three nights in a row.
The phrase of necessity is an adverb that means, basically, "inevitably," or "necessarily." When you do something of necessity, you have to do it. A teacher's voice might of necessity be loud and sharp, to get the attention of distracted students, and a neighborhood shop might of necessity be closed unexpectedly because of water damage from a heavy rainstorm and a leaky roof. Necessity comes from the Latin necessitatem, "unavoidableness."