my one friend was a mechanic until he grew tired on being yanked around by the dealerships he worked at
he worked flat rate - did very well - but then dealer 1 continued to change things around which (surprise) led reduced pay
dealer 2 did something similar - only worse - and that was the end for him
he was incredible - he could have a control arm off a car before I would have it up on the lift lol
the diagnostics mechanics have now are amazing - including the portable stuff ; mechanic can plug into a car and obtain critical info in seconds
last car I sold - guy brought a mechanic who took quick look at the car and then connected a diagnostic tool / something into the harness (or something lol) under the dash
my guess he got a read on compression / emissions / etc ... that type of thing ?
he/they seemed satisfied - and car was sold
What I did for the last 30 years was diagnosis, engine performance, emissions, electronics, the stuff nobody wants to do. There was a dramatic change in 1996 with the introduction of protocols and laws for vehicles to monitor emission related stuff. This is called OBD 2 and the connector under the dash is called the data link connector. This connector allows access to the up to 30 computers on a communication link.
If checking a used car you can see any trouble codes which are set, even if warning lights are not on. If a car has a bad catalytic converter, for example, the seller can clear the light with a code reader and it won't come back on until the computer has failed it's test. A good code reader will tell you if the tests have been run, or not.
In California a car will fail a smog check if those tests have not run. This is a source of much frustration for technicians trying to get the tests (called monitors) to pass. It can be a giant PITA.