This is a convention established by Johann Bayer in his star catalog "Uranometria" published in 1603. He assigned Greek letters to stars within each constellation, with alpha (α) typically given to the brightest star, beta (β) to the second brightest, and so on.
However, there are exceptions to this rule. Sometimes the brightest star might have already been named by another civilization or might not be the brightest in the constellation due to changes in its luminosity over time.