Q:

How is being Wakanda's king and Black Panther connected? 

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. 

A:

Does this mean that there is finally a strong relationship between being the king and being Black Panther?  

Although, in the MCU, there seems to be direct relationship between being King and Black Panther (at least on a hereditary basis) this is not guaranteed. 
Recall, T'Challa IS the Black Panther before he becomes king and only becomes king on the death of his father.  
It's possible that T'Challa could have failed in becoming Black Panther although, of course, he does not. 
It would appear that the burial ceremony becomes part of the assumption ritual when the person becoming Black Panther is also becoming king at the same time.  It seems likely (although the absence of evidence is not evidence itself) that T'Challa gained the powers without the burial since, as I recall, this was his first visit to the ancestral plane. 
Outside of the MCU, (in the comics Earth-616 primarily) there have been Black Panthers who were NOT king, including T'Challa himself when he abdicated and Shuri assumed the throne and was also Black Panther. 

A:

I'll prefix any MCU answers, as I always do, with the statement that the MCU deviates from the comic cannon, but is usually informed directly by the history of the comics.  As per the Marvel production code, gaps in history can be ratified by the comics, although absence does not equate to confirmation, unless stated otherwise.  
That being said; Traditionally, the Black Panther is the head of state of Wakanda; but it seems as though T'Chaka was seeking to move the locus of power towards the Taifa Ngao as part of some kind of semi-democratic process during his reign.  T'Chaka was a modernist in many ways, although T'Challa eventually exceeds his fathers vision of a nation engaged with the wider world.  The 616 continuity of comics actually moves this plot further, and T'Challa is instrumental in the separation of ceremonial roles (Black Panther) and the Ruling Body of Wakanda (Wakandan Constitutional Council); but we're yet to see this in the MCU.  
It's not explicitly stated that the mantle of Black Panther is held until death, and it appears as though the title was bestowed upon his son whilst the father was still alive.  This doesn't appear to have caused any alarm in the MCU's Wakanda, so must be either commonplace or a widely embraced change.  It appears as though, under the constitutional reforms set in motion by T'Chaka, it's possible to retire from the ceremonial (yet functional) Black Panther but retain the seat of power for Wakanda. 
However... this is no precedent for distinct separation at all times, and the roles are treated as isolated even within the MCU Movie. 
Mbaku's challenge is not to the title of Black Panther, it is to the throne.  It is for this reason that T'Challa is stripped of the powers of the Black Panther; so any challengers would be facing The King, and NOT the Black Panther. 
... of course, it's likely that any new King would consolidate his power by also adopting the role of Black Panther, but the ceremony indicates a separation of roles; even when they are occupied by the same person. 