The variation of atomic configurations and their corresponding structural parameters, such as first nearest neighbor distances, is a characteristic feature of ternary semiconductor alloys with zincblende structure. It has a strong influence on important material properties, most prominently the bandgap energy, and can contribute to a nonlinear behavior with changing alloy composition. Using (In,Ga)P as a model system, the atomic-scale structure has been modeled for all possible first nearest neighbor configurations based on experimentally determined structural parameters. While the average position of the P anion corresponds to the ideal lattice site, the average distance from this ideal lattice site does not vanish even in the random alloy. Based on this average anion displacement, the contribution to the bandgap bowing caused by structural relaxation of the alloy was calculated over the whole compositional range. Furthermore, the bowing contribution arising from the overall change of the In-P and Ga-P distances with respect to the binary values was determined. Thus, a clear distinction between the bandgap bowing caused by structural effects on the one hand and by charge redistribution on the other hand is possible.