Why math matters
You have accurately described the problem: one boat can point higher into the wind than another can before the sails begin to luff. It has everything to do with the vageries of hull shape (and everything that comes under that rubric, such as draft, rudder shape, beam placement and width, bilge shape, keel form, etc.), as well as sail shape, condition, placement, size trim and probably a hundred other variables. If you want the mathematical whys and wherefores explained, check out the website below. All I know is that my boat (with a keel/centerboard) doesn't point nearly as high as my friend's keel model.