I was wondering if with an old mac does the processer get slower and the ram smaller????
Already answered, but to be more specific, unlike a car, which is a mechanical device, computers (Mac, PC, or even the embedded controller in a car) are electronic--no moving parts.
This means that they basically either work or they don't--if it works, it should work exactly as well as the day it was made.
If you did no maintenance on the SOFTWARE that runs your computer, it may not run as well after a long time--things could get progressively messed up over years of use that cause more crashes or funky problems. But if you reinstalled from scratch on a 10 year old computer it would run just as well as when it was new.
The only possible exception to this is if a component is intermittently failing, which becomes somewhat more likely over time. It could make the computer more likely to crash because of a hardware problem, but again, it's more of a "yes/no" thing. More akin to a car that stalls periodically than lower horsepower.