The RAF won the battle because it was the RAF that fought the battle. The RN's existence made the battle essentially unwinable for the Germans though. I recall hearing that when the battle is gamed out, even if the Luftwaffe "defeats" RAF Fighter Command, the remaining Spits and Hurris are then pulled back out of Luftwaffe range. When the invasion happens the RN, covered by the remaining fighters of the RAF, slams the door shut within 24 hours of landing. Within two weeks of landing the British are inventorying their new "Made in Germany" equipment as the Germans, out of food and fuel, are forced to surrender. Yes, the RN takes losses, but not nearly enough to stop it from accomplishing its task. What happens to the German troops caught in the channel on the barges by battleships doesn't even bear thinking about.
Try telling that to the men of the HMS Prince of Wales and HMS Repulse.
That was the Japanese, not the Germans. The Japanese were far, far better trained for attacks against ships. In the early part of the war Vals had a 70+% hit rate on ships. Ju87s had less than half of that at Dunkirk. If the Luftwaffe were able to "borrow" the Imperial Japanese Navy's bomber pilots and crews it might be able stop the Royal Navy.