The secret to moist fried chicken is maintaining the correct oil temperature throughout the process. If it's too low, the chicken will be greasy and soggy, and if it's too high, the coating will burn before the chicken is cooked through.
Fill a medium heavy-bottomed pot halfway with oil. Heat until a deep-fat thermometer reaches 340 degrees.
Meanwhile, stir together buttermilk, eggs, baking powder, and baking soda in a medium bowl. Whisk together flour, coarse salt, and cayenne in another bowl. Working in batches, dip each chicken piece into buttermilk mixture, coating completely (do not shake off any excess). Dredge in flour mixture, patting onto chicken to coat completely. Transfer to a plate.
Working in batches (do not crowd pot), carefully place chicken in oil, and fry until deep golden brown, 6 to 7 minutes for wings, 9 to 10 minutes for other pieces. (While chicken is cooking, adjust heat as needed to maintain an oil temperature of 325 degrees. Return oil to 340 degrees before starting each new batch.)
Transfer fried chicken to a paper-towel-lined plate using a slotted spoon; sprinkle with flaky salt. Serve warm or at room temperature.