In general, you should find out what the student wants from the lessons and tailor your teaching to what they want from lessons. Teaching all students the exact same way tends to be counterproductive.
If they are very serious about creating their own music, encourage improvisation as much as possible and reinforce it by showing the theory behind what they play and show them how analysis can be applied to any piece to help them create music. If a student just wants to play their instrument as a hobby, see what artist/composers they like and help them understand what's going on and the musical ideas behind them. If a student is serious about playing their instrument and wants to play professionally or attend music school for their instrument, show them what they need to know and explain how it will help them prepare for the future with some examples of how techniques and ideas are used.
If you know what they want from lessons you can do a lot to keep them interested in their lessons and you can teach them a lot easier. If they are being forced to take lessons, there really is not much you can do. You can try and make it fun for them, but unless they want to learn it is rather hard to keep them interested.
Another thing to note is even the most eager student can get "burned out" of lessons. If you know a student is starting to not practice as much as they normally do, it may be time to adjust their lessons and take them in a different direction for a little bit to rekindle their interest in lessons. Either focusing on a different topic or approaching a topic a different way can help a lot refocus the student to their lessons.