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...