An important thing to recognize in attempting to properly and fully address this question is there is a distinction between the offices of responsibility of the Lord's Anointed Prophet and the President of the Church. They are entirely separate hats, so to speak.
Joseph Smith Jr. was one person who wore both hats. Prior to the organization of the church body, there was a priesthood body organized as well. Even though people could be members of both bodies, they are indeed distinct bodies. Entrance into these bodies is a process of entering into the associated covenants. There are distinctly different covenants involved when a person becomes a member of the church and when a person joins the Aaronic and Melchizedek Priesthood bodies.
Joseph Smith Jr. was the president of both the masculine priesthood body as well as of the feminine church body. The masculine priesthood body was called for in Section 88 of the Doctrine and Covenants and it was called the School of the Prophets and its president was the Lord's Anointed Prophet. This is more precisely understood as the individual to whom God would give the gift to receive the oracles.
This office of Lord's Anointed Oracle is the same as was anciently held by Elijah, Elisha, Jeremiah, John the Baptist, and so on. This is the body of authority that has responsibility over the kings and the priests. This is why Jesus came to John the Baptist in order to have his right to be revered as a King and a Priest recognized and to receive his anointing as such. A similar relationship existed between Jethro and Moses as well.
This office of Lord's Anointed is not something that man has any say in whatsoever. God only ever has one man serving in this capacity at a time. And, it is whoever God calls and speaks to. It is upon the people to hear the words spoken through the oracle and to get their own witness or confirmation that God is speaking through them. This is why under the ancient law if a man presumed to do this and was found to be deceived and/or dishonest in the matter the punishment was very severe. Also, once a man served in this capacity he would remain such for all the remainder of his life and often times there would be specific instructions from God on who the successor would be. In other cases there wouldn't be any successor because of the unrighteousness of the people and/or the oracle.
Where things became to appear that the office of the president of the churh and the office of the Lord's Anointed Prophet were one and the same is from DC 90:3-5 where Joseph Smith Jr. is told who the successor to hold the oracle shall be. He was told the oracle would go to another, even the church. So, rather than being given to an actual individual, the oracle would go to the body of the church collectively. Therefore, so long as it remained worthy of the gift, the president of the church would also be the successor to the office of the Lord's Anointed Prophet and be the oracle. Therefore, upon the passing of Joseph Smith Jr., the process the church uses to call a new church president is also the defacto process by which the oracle would be passed on.
The basis upon which a new presiding high priest is selected to become the president of the church is that he is "chosen by the body" and "upheld by the faith, confidence and prayers" of the saints. In other words, it was the body of high priests who gathered together and held some kind of a convention to determine how this was done. Apostolic seniority was the process decided upon by the body of priesthood brethren and so this is what has been used ever since to determine who the new president of the church would be, which also had ramifications upon who the oracle would be as well. Therefore, not only was Brigham Young the rightful president of the church, he was also the rightful successor of the office of Lord's Anointed Oracle.