There is no 'necessary connection' between what is legal and what is moral. [=what is legal does not always have to be moral and what is moral does not always have to be legal]
Higher prices are a 'necessary consequence' of the company's new services.
I'll 'do the necessary' [=do whatever is necessary] to get the job done.
(..) - We are all dead. Can you not see? You're a destroyer, Odinson. See where your power leads. Sloppy. Pretending to fail. The ceremony is necessary, for you to take your place in the world. - I have no place in the world. - Exactly. - What can I do? - Ah, it hurts. (..)2015 Avengers: Age of Ultron