some buy commercial strains, some isolate single cells of a strain they've been using traditionally (either purchased commercially, mutated from a past commercial purchase, harvested from the wild, been used in the brewery for 100's of years, etc) and propagate each new pitch up off a pure, single cell culture.
For most strains, its a process of selective pressure. For instance, German Lager yeast came to be because the beers in Germany were fermented in cool caves. This favored the cells that worked best in a cooler environment, and with each re-pitch and subsequent yeast growth phase, more and more of the cool temperature favoring cells reproduced, while the others were slowly phased out.
Just like top cropping english ale yeasts. They used selective pressure because only the yeast that rose to the top of fermentation got a chance to be re-pitched into the next batch and reproduce. Eventually your entire yeast colony will be made up of these top croppers, since you never give the ones that stay at the bottom a chance to make it into the next batch and reproduce.
Combine this with single cell pure culture techniques, and you can isolate the exact strain you like, and grow up a pitch from a single cell.
I think most large brewers have a lab in house to maintain their yeast, while most smaller brewers buy commercially.