In standing poses where the knee is bent, correctly aligning the knee is especially important because the knee joint is bearing weight. In poses where the hips are facing forward, the body finds a safe alignment fairly naturally, just as it does every day when we walk or run. However, in poses such as Warrior II and extended angle pose (and Warrior I to a lesser extent), we put the body in an un-natural stance, with the pelvis facing sideways and the front foot facing forwards. When we then bend the knee, our body often comes out of its safe alignment, for a number of different reasons (stiffness in the hips, short adductor muscles, distraction…).
You'll often hear teachers cue "bring your knee over your ankle" to try and correct for this. But we all know that bringing the knee directly over the ankle in these poses can take years of practice! Instead, don't worry about how far forward your knee is: check the alignment of your knee by thinking about lining up two straight lines. The first (in pink) is a line that goes through the middle of your foot: approximately from the base of the second toe to the middle of the heel. The second (in blue) goes from your hip socket in the middle of the upper thigh to the middle of the kneecap. When those two axes are in line, you are good to go!
The pictures below hopefully makes it pretty clear. In 1) and 2) I've shown two common mis-alignments that I often see in class, just to help illustrate the point. 3) shows what it should look like.
(PS: You usually can't see your foot from standing in Warrior II, so lean forward to check your alignment, and then straighten up again).
My cat has recently been taking a renewed interest in disdainfully watching me do yoga, so you also get a bonus of some cute little cat feet off to the side!!