Ideally you should find three types of training partners. Those close to your level, those above your level, and those below your level. Each one offers unique benefits.
Above your level keeps you in check. It shows you whether techniques and strategies you are working on are actually effective or if you are just pulling them off on inexperienced people. And it helps you develop your defense.
But if you only train with people much better than you, your offense will be limited as will your toughness. Because it is not as mentally difficult to just get smashed by someone way better as it is to battle with someone you can potentially beat.
Training with people at your level is good because it develops willpower. Many times you will see people come up the ranks together. This rivalry can be very effective because both people are constantly figuring out ways to beat each other. Often times victory happens for the guy who wants it more that particular day.
This type of training is great but if you only do this, you can get sloppy. You get so focused on winning you don’t spend enough time refining.
Training with people below your level is a time to develop your offense and your timing. You can work on submissions but allow the person to escape just to see what type of reactions people will have.
But you need to be careful because too much training like this will start to give you false confidence about the effectiveness of your attacks.
Ideally you develop your defense with people above your level, develop your offense with people below it, and blend the two together with people at your level or in competition.
Now the real question becomes how much time spent with each type. This is a constantly changing variable depending on your age, stress, and what you are training for.
If it is for life/self defense more time should spent refining the feel and timing of techniques vs hard training.
Remember that being physically healthy is one of the best self defense techniques that you can have.