Valve adjustment out=dies at high rpms?

Okay, this issue is fixed, but i would like to know a little more about what was wrong just to further my knowledge on these things…
So I was working on a bike and it was having an issue after a top-end rebuild(previously skipped time and bent valves) That once it would hit High rpms like on a long stretch it would bog down and die. but if You were not pushing it or if it was idling it would be perfectly fine. it was popping a bit too when you’d go up high acceleration and let off. so He ended up taking it to another guy to look at it and he said it was the valve adjustment? he also rejetted the carb I think. And now it runs perfect.
So how would the valves being out cause it to die when going up on higher rpms? if they we’re too loose would they not open up enough to let enough gas in at high rpms where it uses more?