Two people have two problems:
Willy Wonka wants to assure the continuation of his chocolate factory upon his demise, but he has no natural heir. So he must go out and "adopt" one. He wants to be sure to choose someone worthy of the task, since the future of the company is as stake. So he arranges for the contest. Through a series of challenges, he will screen out the best candidate.
Charlie is ultimately chosen, but to fulfill the necessary requirements, Willy Wonka would have him abandon everything for his project. Charlies loves his family and cannot leave them in the lurch. Wonka can't understand such family attachments since his own family history is lacking in this domain.
The resolution comes when Willy Wonka finally realizes why he feels this way. His father, who was a dentist, treated his own son as an orthodontic "project" instead of a person; it is natural then that Wonka would repeat these same mistakes with Joe as long as these reasons are submerged in his memory.
Willie Wonka's memory is later shaken and he recalls his past. He is more compassionate then towards Charlie, and Charlie is able to "take the reins" of the Wonka business without abandoning his family.
There are other problems which arise, such as Charlie's hestitation to even keep the winning ticket for himself and later the exploitation of the Oompa-Loompas, but the main gist of conflict remains in Wonka's quest for an heir and in Charlie's conflict of loyalties.