BEM gives useful patterns and methodological recommendations on writing CSS, JavaScript, templates (and other web-related techs) in an extra-semantic way.
Besides it's a pleasure for developers, it also helps to keep interfaces fast-to-develop and easy-to-maintain in the long run.
The three terms uncover their meaning in this well-illustrated article.
Try BEM idea of independent blocks, BEMHTML template engine, writing extra semantic JavaScript, linking a library to the project and redefining its functionality at the project level.
Once upon a time, in a distant country far-far away, an IT company named Yandex started developing web search and affiliated services...