For programs that can only use two cores the i7-7500u would be better. For programs that can make use of 4 cores the i5-6300HQ would be superior.
For programs that can process 4 threads of instructions (whether 2 physical core + 2 Hyper Threads, or 4 physical cores), the i5-6300HQ will be better. In a nutshell, Hyper Threading allows one core to process 2 threads of instructions, but not at the exact same time. When thread is a stopping point like waiting for a result from a calculation being performed by the other core, it can switch to the other thread until it reaches another break.
Here's a simple analogy...
Your mouth is the CPU core. Your right hand feeds your mouth food (instructions) to chew on and swallow (process). You can only consume so much food depending on how much food your right hand is feeding your mouth and how fast you can chew and swallow your food. If you finish eating the food before your right hand feeds you the next piece of food, then your mouth is doing nothing.
Hyper Threading is like your left hand feeding your mouth food. When you are done eating what your right hand fed your mouth, but your right hand is still reaching for more food, then you eat what is in your left hand. By the time you are done with that, then your right hand will most likely be ready to feed your mouth while your left hand is reaching for more food.
Assuming you are a freak of nature.and have two mouths (two CPU cores). Then you can eat food from both hands at the same time.