Commissions were purchased (until 1871) only within the regiment, i.e. up to lieutenant-colonel. (Even then promotions by merit or seniority were possible under certain circumstances, usually when a vacancy occurred due to death rather than selling off; and the RA and RE didn't sell commissions.)
The promotions to colonel and to the general officers rank were at the discretion of the superiors. Of course this opened the door wide for all sorts of favoritism and abuse. Even if some commanders turned out to be good, even excellent, this was far from being the rule. Wellington notoriously deemed his generals (whether superiors or subordinates) perfect amateurs. Of one is his superiors he wrote (around 1808?), quoting from memory, "the general has no plan, or even the idea of a plan, nor do I believe he knows the meaning of the word plan." And of his subordinates some years later he said "nobody ever reads an order in any other manner than as if it were an amusing novel, and when the order to advance is given, and complicated arrangements are to be put into execution, every gentleman proceeds according to his fancy."
I think it's only necessary to see how much high command remained the sphere of the nobility during these decades up to and including the Crimean War to realize how small a role actual military experience, let alone expertise, played in advancement into senior general officer ranks. No patronage--no gold lace.
Of course, the Royal Navy way of advancement, exclusively by seniority once post rank was reached, was not much better. Just think Provo Wallis. [:D]
<center>
D.S. "Green Horse" Walter, Maréchal d'Empire
Duc des Pyramides, Comte de Normandie
Commandant la [url="http://home.arcor.de/dierk_Walter/NWC/3_VI_AdR_Home.htm"]3e Division Bavaroise[/url], L'Armée du Rhin
Commandant [url="http://home.arcor.de/dierk_Walter/NWC/EdM_start.htm"]L'Ecole de Mars[/url], L'Armée du Rhin
Commandant la Brigade de Grenadiers de la Moyenne Garde

</center>