It's all in the timing of adding the garlic and onions (which can only really be learned through trial and error). Adding them too soon will cause them to burn before the potatoes are crisp, and too late will prevent the garlic and onion from fully caramelizing.