First, as soon as he saw Mr. Miyagi practicing the Crane Technique while at the beach he asked Mr. Miyagi if he would teach it to him. Mr. Miyagi had to explain it was only for the most advanced practitioner of the martial arts.
"First learn stand, then learn fly, nature's rule Danielsan, not mine."
Then while Daniel was practicing his blocking moves and his balance on the bow of Mr. Miyagi's boat he expressed his impatience by asking Mr. Miyagi when he was going to teach him how to punch.
"Learn punch once learn balance."
Its not out of the question to believe Daniel would seek training elsewhere if he felt he wasn't progressing fast enough under Mr. Miyagi's tutelage.
We get evidence of this in Karate Kid 3 when at the first sign of trouble Daniel heads and begins taking classes from original Cobra Kai member Terry Silver.
As you can imagine it did not go as smoothly as planned.
It lends credibility however to the theory that Daniel grew restless in Karate Kid 1 and when Johnny came to him with an offer Daniel jumped at it and added his own stipulations, one of them being Johnny had to secretly train him in anticipation of the All Valley.
That would explain how Daniel did so well and was able to take out four Cobras at the All Valley.
Johnny was the defending champion and a karate tournament expert, it is not a stretch to believe that with Johnny's help Daniel was able to defeat them. Johnny knew their moves, he naturally would have known how to take them out.