I've always believed that it has something to do with the architecture of your mouth, which can vary considerably among people. There are your obvious over and underbites but also many other more subtle differences. I've never been able to whistle loudly and lord knows I tried to learn when I was younger...gave up a long time ago. Other kids could do it easily, it's not exactly some genius level skill. As a consolation, I can whistle nicely at normal volume using the old, "put your lips together and blow" method and also do the wind whistling thing.
On a side note, literally, the most amusing whistle is known as "the Mexican whistle" that seemingly all guys from that part of the world can do. I think that I first heard it used regularly by Danny Trejo, the quintessential Mexican, many years ago. Before he was even an actor, I knew him. He does it with a skill and with comic timing that even impresses his countrymen, much less any gringo. It's sort of an *up and down* tone done in quick succession that really sounds like the whistler is trying to say something or issue a warning...you really know it when you hear it. Anyone in SoCal knows what I'm talking about. It's also used when someone doesn't want to say a dirty word and it can be side-splitting hilarious in that context.
Many people thought that Leo DiCaprio should have won the Oscar for "One Battle After Another" simply for his Mexican whistle after getting directions from the two guys on the side of the road during the car chase sequence. It was perfection but of course, he's a local boy, grew up in Los Feliz.