Give the players what they want, most of the time.
After playing with the same people for a couple of years, I kind of noticed a pattern in the enjoyment of each one of them. I know that all of them liked the challenge of combat, so I made sure to place at least a few challenging combats in every adventure and not make it 100% rp so as to bore them. They were also big fans of magical items and treasures...so whenever I think they deserved it, I'd give them magical treasures (even though it was totally unnecessary on my part).
Basically, I listened to what they wanted and there were always complaints along the way and suggestions after each adventure and I'd try to incorporate them into the next ones. Being DM is a bit like what I've learned of leadership in Business Administration, there are different types of leadership roles for different type of groups. Autocrats, democrats or those who just lets the group run for itself.
Then there is a theory which says with a group that is of low ability and low motivation (let's say they play just for the sake of playing, and are not very good at rp or rules), then you can adopt the role of speaker who orients them a lot to try to bring them to the next level upon where they gain motivation.
With a group of low ability and high motivation (sure, they really love coming to the sessions, but are not very good role-players or strategists in fights), then you can adopt the role of salesman and orientator, where you 'sell' the gaming fun to them and orient them through the adventures, allowing them to learn more from experience as the gaming sessions add up.
With a group of high ability and low motivation (say, experienced role-players, usually those who have played for a good number of years but lack that desire to continue playing) you can be the participant leader, who works with them but doesn't have to orient them (as they know the rules, how to role-play and all that). You just have to focus on motivating them.
And for a group of high ability and high motivation which is ultimately what you want (a group of experienced players who seek and know how to have fun in a session regardless of DM), then you can adopt the role of delegate or one who delegates (gives out) responsibilities, and you don't have to orient or support them. This is the group where if you say 'here's the map of the dragon lair where the elven child has been taken, now deal with it', they are capable of role-playing between themselves, come up with ideas, solutions for diverse problems and don't need the DM to take them down a straight line all the time. I think this is the group where you can LET them run the adventure...they are the narrators, and you're just there to give the basic storyline and say what the consequences of their actions are.
Heh, I'm not sure if I've linked the theory well with being a DM, but I still believe leadership skills that you'd apply for a business and being a DM is very much connected.
You'll usually want to avoid negative leadership which is where you punish individuals of the group for certain actions, and adopt positive leadership which is where you give benefits to the deserving individuals (applying this to RPG, maybe XP rewards for role-playing, that kind of thing...).
And most of all, and I can't stress this enough, is being able to read the minds of the group, learn what motivates them (so you can use it for your advantage)
and the rest is having fun yourself (as you're not paid to be a DM, don't exhaust yourself thinking 'where am I going wrong'?).
Usually when you have fun, the players have fun too.