My answer addresses tennis.
Perhaps the most important advice is mental. If you want to improve, do not have an arrogant or superior mindset on court. Focus on improving yourself.
If your partner is not able to consistently return your balls, you are essentially limited to polishing your own footwork, technique, accuracy, and feel.
Otherwise, there are many additional things you can practice - depending on your own level. For low-level players, I suggest focusing on technique, footwork, and accuracy. For mid-level players, force yourself to work on the strokes you're less comfortable with e.g volleys, slices etc. Eliminating gaping weaknesses is the main obstacle to becoming a high(er)-level player. When you feel more-or-less comfortable everywhere in the court, work more on your feel.
If you are a high-level player you will find it surprisingly difficult to play normally against much weaker opponents, since you'll have far less pace to work with. Given that you will have ample time to think on court, I suggest thinking about the mechanics of your strokes. From my experience, this is very helpful in quickly making the necessary adjustments against different players e.g lefties, big hitters, pace changers etc. Apart from this, you should know what it is you need to be working on.