In the U.S., caffeine is not a highly regulated substance. You can buy it without limits in concentrated pill form, or in coffee and cola. By contrast, amphetamine is regulated as a Schedule 2 controlled substance [0], i.e approved for medical use but considered to have "high potential for abuse". Opioids like fentanyl are also in Schedule 2.
[0] https://www.deadiversion.usdoj.gov/schedules/