Ale would be considered a subcategory of beer, actually. I'm going to ignore various legal definitions because they're silly and arbitrary.
Beer is an alcoholic beverage made from fermented grains. You can split beer into many subcategories, but two common ones are ale and lager. What differentiates these two is the temperature of fermentation- ales are fermented at roughly room temperature, and lagers are fermented at much lower temperatures.
What makes this difference is the yeast, and in fact we recognize two different species of yeast- ale yeast is saccharomyces cerevisiae, and lager yeast is saccharomyces pastorianus aka saccharomyces carlsbergensis.
Stout is often noted as separate from ale and lager, but if we're using temperature of fermentation as a basis for categorizing, it fits in ale category.
Nothing is black and white of course, so there are things which blur the lines. A style called California Common, best known by the beer Anchor Steam, is fermented with a lager yeast at warmer temperatures. The converse is a cream ale- an ale yeast fermented at low temperatures (though not always... shades of grey).