We study the emergence of coherence in complex networks of mutually coupled nonidentical elements. We uncover the precise dependence of the dynamical coherence on the network connectivity, the isolated dynamics of the elements, and the coupling function. These findings predict that in random graphs the enhancement of coherence is proportional to the mean degree. In locally connected networks, coherence is no longer controlled by the mean degree but rather by how the mean degree scales with the network size. In these networks, even when the coherence is absent, adding a fraction s of random connections leads to an enhancement of coherence proportional to s. Our results provide a way to control the emergent properties by the manipulation of the dynamics of the elements and the network connectivity.