Whereby means by which means. An arrangement whereby, a scheme whereby, the process whereby it happens.
It is formal and belongs to contracts and reports, and it always introduces a clause explaining how something works. Plain writing usually prefers by which or a full stop and a new sentence, and the meaning is not lost.
1adverbwherebyBy which means.
“The company introduced a scheme whereby staff can buy shares at a discount.”
whereby is a connective.
Where plus by, one of a family with wherein, whereof and whereas.
From where + by.
Etymology from Wiktionary, CC BY-SA