Here's how it works. Plain and simple.
Gr.4 cars are equal to real-world GT4 and TCR cars, with some similar cars like the Alfa Romeo DTM and Renault Megane Trophy included due to their similar performance.
Gr.3 cars are equal to real-world GT3 cars, with some similar cars like the older GT500 Supra and GT-R included due to similar performance.
Gr.2 cars are modern Super GT (GT500) and late-90s Le Mans GT1 race cars. They are basically prototype racing cars made to look like street-legal cars. Late 90's GT500 cars like the Tom's Supra and Pennzoil GT-R aren't quite as advanced or as fast, so they get sent to play with the GT3 cars in Gr.3.
Gr.1 is basically top-flight Le Mans Prototypes stretching all the way back to the 80s and including concept cars from the 2010s and 2020s.
Here's how tuning works:
Race car classes are denoted by the group beside their PP indicator. For example, a GT3 car would be read something like:
( 730 PP / Gr.3 ) in the tab where it displays it.
You can tune a road car to be equal in performance to a GT3 car, for example, but it will not become classified as such in the game or become eligible for the class and that classes' BOP in online and certain class-restricted offline events. The car you use for those must have a group label to be considered.
You can also tune some race cars, but tuning a Gr.4 car would just make it a faster Gr.4 car. It's not like Forza where the car would change ranking by the game and enter a different class once upgraded. A car remains in its class despite the amount of upgrades it receives. Also, any modifications you make to cars will be temporarily disabled in events where BOP applies.
I think that covers everything about the game's class system. If you have any questions or doubts let me know.