T'Challa was Black Panther before being king. It means that both functions are independent.
The throne is hereditary by default (but can be challenged) and the Black Panther role is maybe hereditary (or given to the best candidate, it is not clarified in the movie)
T'Challa's father dies so he is the natural heir to the throne. He may be challenged, though. For the challenge to be fair, if the prince happens to also be Black Panther at that time (as it is the case in the movie), it is stripped of his powers for the challenge.
I do not understand why he is stripped before even someone challenges him (and not after someone has expressed the will to challenge) but never mind.
He is then proclaimed king (after being challenged and winning) and his Black Panther Powers are given back.
Does this mean that there is finally a strong relationship between being the king and being Black Panther? And that the son becomes Black Panther when the father cannot be it anymore? Or that Black Panther is assigned differently?
EDIT: another question discussed the role of the ceremony when T'Challa is buried. The answer is
The purpose of the ceremonial burial is to travel to the "Ancestral Plane" so that the new king may consult with his ancestors.
This implies that the king is necessarily Black Panther as well, or rather that once he gets to be the king, he receives the Black Panther powers.
This could lead into a case where the king is old, makes his son Black Panther, the father dies, the son is challenged and loses and someone else is the king and becomes Black Panther as well.