All I7, I5 , I3 start out of the same process of building/ Fabrication process. Intel and other silicon manufacturers do have process to test and classify these into high grade(Meaning I7), Middle grade(I5) and Entry level grade (I3). This process is called binning which is explained below.
Intel has standards for performance, power management and thermal output for its Core i5 CPUs. If a CPU fails to meet those standards, Intel will bin it as an i3 processor instead. However, since Core i5 processors have four cores and i3 processors have two, Intel will disable two (likely defective) cores on the processor in order to sell it as a two-core processor. Thus, it’s possible your desktop’s i3 processor was meant to be an i5 but failed to meet performance standards, so Intel disabled two of its cores to turn it into an i3.
And vendors may bin-out high-performance components by disabling some of their capabilities and marketing them as lower performance to meet their own supply/demand needs. For instance, if a high-end CPU isn’t selling so hot right now, supply would be high. A vendor could disable compute units in some of these high-end CPUs so that they’ll fit into the more highly demanded mainstream market and have a better chance of selling.
One should also note that silicon tape out process also called fabrication is a very expensive process and manufacturers use this binning process to squeeze max possible returns out of these fabricated processors .
Now coming to differences/ Advantages of I7 v/s I5 – you haven’t asked for specific family or generation. I would generalize these differences / advantages .
No of cores :- current generation I7’s have more physical cores than I5’s
Pricing and Market segment :- I&’s are usually intended for premium market on average about 150 USD more than the middle segment I5’s.
Cache Memory :- Core i7 processors have larger cache (on-board memory) to help the processor deal with repetitive tasks faster. If you’re editing and calculating spreadsheets, your CPU shouldn’t have to reload the framework where the numbers sit. This info will sit in the cache, so when you change a number, the calculations are almost instantaneous. Larger cache sizes help with multitasking as well, since background tasks will be ready for when you switch focus to another window. On currently available desktop processors, most i5 CPUs have up to 9MB of L3 cache, while most i7 processors have up to 12M
Turbo Boost :- Turbo Boost is an overclocking feature that Intel built into its processors. Essentially, it allows the processor to run faster than its base clock speed when only one or two processor cores are needed (like when you’re running a single-threaded task that you want done now). Both Core i5 and Core i7 processors use Turbo Boost, with Core i7 processors achieving higher clock speeds
Hyper-Threading :- all Core i7 CPUs use Hyper-Threading, so an eight-core CPU can handle 16 streams, a four-core can handle eight streams, and a dual-core can handle four streams. Core i5 uses Hyper-Threading to make a dual-core CPU act like a four-core one, but if you have a Core i5 processor with four true cores, it won’t have Hyper-Threading . My laptop has a I5-8400, This has 6 physical cores and not logical hyper threading cores.
Integrated Graphics :- You’ll find Iris Plus and higher-end Intel HD/UHD graphics on Core i7 CPUs, while Core i5 processors feature one of the myriad versions of Intel HD/UHD graphics, depending on the part number. Integrated graphics save power, since there’s no extra graphics chip on your laptop or desktop’s motherboard using power.
To Summarize:- Intel Core i5 is made for mainstream users who care about performance, and Intel Core i7 is made for enthusiasts and high-end users. I3 would be for price sensitive entry level applications/ needs. Only extreme users need to consider Intel’s Core X-Series -which is a class of processor which is in a market segment above I7 as well.
Hope this helps