It is used as a drink or ingredient of other dishes, and in many cases can work as a substitute of cow's milk. Soy milk is the most popular in North America, Europe and East and Southeast Asia where it can be found for sale in many shops and comes in a variety of flavors (plain, vanilla, chocolate, banana, etc.)
Soy milk was invented in China centuries ago, as a by-product of the production of tofu, where the usual term is Doujiang 豆漿 (lit. "bean broth"), and then spread to neighboring countries. To this day it is one of traditional foods in China, Taiwan, Japan, South Korea, Vietnam, Malaysia. Soy milk became popular in the Western countries only at the end of 20th century.
Soy milk can be easily produced at home at much cheaper price than buying it already made in shops. To do that, soybeans have to be soaked for several hours, then blended with water, the whole mass boiled for 10-15 minutes and strained to remove solid parts. The resulting white liquid is soy milk. It then can be flavored with salt, sugar, vanilla, etc. To simplify the process, one can also use a special soy milk machine.