How I understand it, ~べく, meaning "for the purpose of..." / "In order to....", is the conjunctive form of ~べき, which indicates something that should be done.
たくさん本を読む べき (you should read many books)
エンジニアになる べく 一生懸命勉強した (I studied hard in order to become an engineer)
In the following example sentence, is the べくして related grammatically or semantically to ~べき or ~べく?
起こる べくして 起こった事故だった。 It was an accident waiting to happen.