This cue sounds counterintuitive, because it is. Think about how you bend down to grab things on the ground; your knees likely go past your toes, because that's how your body works. So, can you just ignore this cue the next time a workout instructor says it to you?
Well, there's a reason why this squat tip exists. According to the American Council on Exercise (ACE), an old study from 1978 first found that keeping the shins as vertical as possible make squatting motions feel easier on people's knees. Then, another 2003 study confirmed that knee stress increases 28% when the knees pass the toes during a squat. So, if you're someone with knee issues, it might behoove you to pay attention to how much your knees bend in a squat.
But in practice, experts realized that this rule doesn't really work for everyone. People with long legs or small feet would obviously have more difficulty keeping their knees behind their toes, for example. Those who lack hip or ankle mobility could just sacrifice their form further by stopping their knees. And for some, keeping the knees bent at 90-degree angles puts excess stress on the hips and lower back. Eventually, it was decided that it's more valuable to focus on other aspects of form, and let the knees bend as much as they want.
What's more important than keeping your knees behind your toes is maintaining even contact with the ground through the balls of your feet and heels, according to ACE. Before you lower down, think about hinging at your hips and driving your seat backwards, so you can target your butt muscles and allow your knees to bend naturally. (You can practice the hip-hinging motion a few times to warm up.) From this position, your knees should glide over your second toe as much as they're meant to.
Ultimately, we all have different muscular imbalances, so it's worth it to figure out what works for your body. That might mean working with a personal trainer who can assess your form on specific exercises, or just asking your workout instructor for a few pointers after a class. If you do have knee or hip issues that make squats painful, a physical therapist can help figure out what the problem is before it gets worse.
Bottom line: sometimes rules and knees are meant to bend.