Let's say you are gaming on an i5, and all of you 4 cpu cores are utilised by the game. Suddenly windows 10 decides to run some irrelevant bloatware out of the blue, this new software wants some CPU time but all your 4 cores are occupied. What happens is that the CPU starts switching (very fast) between one of your game threads and this new software. This will create the illusion that the game and the bloatware are running at the same time.
All seems to be ok right? In theory, you should just lose a few fps at most especially if the bloat software isn't that CPU intesive. However, what happens in reality is different. Each time the CPU switches between one of the the game threads and the bloatware, it has to copy and keep track of a lot of stuff called "program context". This in turn introduces a latency called context switching cost, which wastes CPU time. One benefit of hyperthreading is that it reduces this cost for a fixed number of thread. The other optimisation is that when two threads want a core, it allows a secod thread to use the part of the core that is not utilised by the first thread (threads of a program do not necessarily use all satges of a core at the same time).
So while the computational power of the CPU should theoretically be the same, hyperthreading makes your CPU more efficient at running programs and increases the utilisation. So in practice, the bloatware is less likely to cause hiccups and stutters when you have more threads. Change the blaotware in this example with any other program you might run while gaming, encoders/recorders/streaming/etc. Or if the game you are running can utilise more than the number of physical cores that you have, threads of the same game can benefit from hyperthreading and allow your game to better utilise the CPU.
This was of course, a very simplistic explanation, but it should give an idea of why hyperthreading is useful. This is why I always suggest Ryzen 5 over i5 especially to gamers. In a real world scenario you rarely run just the game in a clean install of windows, and this will result in performance hiccpus not reflected in online reviews. If you have a couple of more threads(or even better, cores) available, you won't have to worry about other processes running while you game.