Ignition timing is affected by a lot of factors. As mentioned chamber design, intake valve opening, quench clearance, but one that most do not mention is rod stoke ratio. The rod stroke ratio controls the amount of time the piston dwells at TDC, before starting down the cylinder, You want to fire the mixture just before the piston starts down the cylinder for maximum torque. The other factors mentions basically control the speed of the burn. The speed of the expanding flame front driving the piston down is the next biggest factor.
A dyno or drag race time slips and reading the strap on the plug, is how to get it perfect. A good engine program will get you close. I use Performance Trends software, it will calculate an advance curve, as well as max timing. I find it to be with in a couple degrees on most engines.