For me it’s ~300mg caffeine to almost be as good as 10mg Ritalin, but I have to re-dose the caffeine often. Think a gram or more a day.
Both have an impact on cardiovascular health, but my impression is that Ritalin and the like are much safer than what people self-medicate with.
My doctor put it this way: Caffeine triggers a useful dopamine response, but the side effects are strong at "useful" levels.
Ritalin and Adderall provide a stronger dopamine response with fewer side effects at "useful" levels.
They're all stimulants, but the magnitude of the useful vs. non-useful effects differs.