Depends really.
But in most cases, it's about someone who is looking at the structure of the club, rather than trying to get the best performance out of the club day-to-day.
To illustrate this, a head coach is the one responsible for making sure he's getting the best out of the group of players he has.
The director of rugby is responsible for making sure the head coach has a sufficient pipeline of talent. Leinster do this extremely well with that connection between schools -> academy ->Leinster squad. In the case of Leinster, they've got a way of playing and a structure that works all the way through that system, so that it develops the sorts of players that will be useful in the future, they know how to play in a Leinster jersey by the time they get there, etc...
They'd also generally be responsible for making sure the facilities are up to scratch, logistics are right, etc... Frequently also deciding the coaching ticket, rather than the head coach. Also, doing press liaison, budgeting, that sort of thing.
Putting the responsibility of all of that and the best performance out of a team on the pitch, deciding tactics, player development, running sessions, etc.. is quite a lot for one person to handle and usually the same skillset isn't found in the same person. Again, Stuart Lancaster is a good example, he hated the politics and press around his role as England coach, in Leinster, he doesn't have to worry about any of that, Leo Cullen handles most of it.