coffee creates a dependence on its user. try drinking coffee daily for months, then go a few days without it. your headaches will be fucking unbearable. my psychology teacher had this feeling even when he thought he was drinking coffee when he was drinking decaf, so it isn't even placebo effect

and the headaches you're stopping are caused by what you're using to stop them

coffee does taste great though, it does get the mind working well, just try not to make a habit of drinking it every morning