No, laptop generation is not the only thing that determines the processor speed. While comparing processors you need to consider many things like Base Frequency, number of cores and threads, etc.  For example, i7 8700k has a base frequency of 3.7 GHz and i5 10210u has a base frequency of 1.6 GHz