what's the difference between intel core i5 7th gen and 8th gen processor

Solution
Since you are asking in the laptop sub-forum...

7th gen i5 CPUs are either dual core ULV (ultra low voltage like the i5-7200u) CPUs or the "HQ" quad core CPUs; let's just call them "normal performance" CPU that has higher performance. The i5-7300HQ is an example of a 7th generation CPU with 4 cores that can reach up to 3.5GHz.

8th gen i5 CPUs are quad core ULV CPU and they also have Hyper Threading (HT) similar to how 7th quad core i7 CPUs that also has HT. HT can allow each core to process 2 instructions sets at once instead of only one... if the program(s) have been designed to take advantage of HT. The typical 8th gen i5 CPU you will find in laptops is the i5-8250u. While it can reach up to 3.4GHz, it can only do so for very short...

Eximo

Distinguished
Herald
All 7th gen core i5 are quad cores. All 8th generation core i5 are hexa-core (six cores).

More cache to go along with the increased core count. Slight architectural speed improvements, higher clock speeds.

They also use different chipsets and motherboards. H110, B150, B250, Z170, Z270 for 7th gen, Z370, H370, H310, and B360 for 8th generation.

Do not let the same LGA1151 socket trick you, 7th/8th gen are not cross compatible. (6th and 7th gen are though)
 
Since you are asking in the laptop sub-forum...

7th gen i5 CPUs are either dual core ULV (ultra low voltage like the i5-7200u) CPUs or the "HQ" quad core CPUs; let's just call them "normal performance" CPU that has higher performance. The i5-7300HQ is an example of a 7th generation CPU with 4 cores that can reach up to 3.5GHz.

8th gen i5 CPUs are quad core ULV CPU and they also have Hyper Threading (HT) similar to how 7th quad core i7 CPUs that also has HT. HT can allow each core to process 2 instructions sets at once instead of only one... if the program(s) have been designed to take advantage of HT. The typical 8th gen i5 CPU you will find in laptops is the i5-8250u. While it can reach up to 3.4GHz, it can only do so for very short periods of time because it is a ULV CPU; reviews that reveal that the i5-8250u can only sustain roughly about 2.5GHz continuously as long as the CPU is not overheating. However, having HT can help performance a little bit (Windows background programs can make use of HT), or a lot if the programs you use can take advantage of HT. The vast majority of games do not take advantage of HT; the only two I know of are Overwatch and the most recent Rainbow Six game.

The 7th gen i5-7300HQ can sustain 3.5GHZ when two cores are being use or about 3.2GHz if all 4 cores are used... but only if the CPU is not overheating.
 
Solution
You know I forgot about the 8th generation Core i5 "H" series CPUs; an example would be the i5-8300H.

These are 45w quad core core CPUs with Hyper Threading (HT). Basically they would be the equivalent to 7th gen Core i7 "HQ" CPUs (4 cores and HT). The 8th Core i5 "H" series can attain max clockspeed when two core are used and the CPU itself is not too hot (determined by Intel). Therefore, they are more powerful than the 8th gen Core i5 "u" series CPUs. 8th gen Intel i5-8300H CPUs can be configured at either 45w or 35w TDP. I do not know if there are any laptops that has a BIOS which allows users to select between the two TDP settings. It is likely set by the manufacturer and is locked.

The lower TDP of 35w naturally means that the max clockspeed can only be reached for very short period of time. However, an 8th gen Core i5 "H" CPU set to 35w TDP would still perform better an 8th gen Core i5 "u" which can be set to 25w TDP (most likely by the manufacturer only), but the typical configuration is 15w which means lower clockspeeds to keep heat down.