What is the meaning of [Necessity knows no law]

The proverb could be used to justify the behaviour of a man who steals food to
keep his wife and family from starving. As Cervantes wrote in _Don Quixote_ :
‘Necessity urges desperate measures.’