Competitive network determines the direction of the diversity-function relationship