The answer is simple:
1. Scholarships. You need them. If you look at the top XC teams, a majority of their scholarships are in distance, or they have something that attracts top talent along with generous financial aid (i.e., Harvard). Very few teams are doing it without substantial scholarship. Virtually every no-name school (Cal Baptist, Furman, etc.) is getting there by sinking all their scholarships in.
1a. Talent and Recruiting. This goes hand in hand with #1, but the more talent you collect, the higher your chances. Recruiting your butt off and getting #s. Or in some cases, foreign talent.
2. Some loophole. Every school has their loophole that allows you to spread those scholarships further. Arkansas had the housing deal and the "states that touch Arkansas" can get in-state under McDonnel. Every school has there thing that turns 12.6 into "17" scholarships.
3. Support. From an AD, boosters, the school.
4. In charge. Either you are the man making the decisions or have the power to have a lot of control over $.
Only after these things do items like coaching come in.
A perfect example of this is the first NAU coach to start the dynasty, Eric Heins. Started a dynasty. Retires for a few years. Comes back to Louisville as an assistant. They are not good during those few years he's there. Is he a bad coach? Not recruiting? Of course not, he's a great coach. It's just at Louisville, he's not the head coach, his scholarship numbers are limited, and so on. They aren't going to be good.