Difference between medicinal caffeine and regular caffeine
From a pharmacology point of view, there is no difference between caffeine in caffeine pills and in a cup of coffee. It doesn't matter, how a chemical substance (in this case caffeine) is made, the effect of the substance is the same. What can make a difference is the presence of secondary plant ingredients.

For pure caffeine there are two possible sources: By chemical synthesis ("A Novel Method of Caffeine Synthesis from Uracil") and as a byproduct of the decaffeination process when producing decaffeinated coffee.

What is also different is the amount of caffeine. While pills contain standardized amounts of caffeine, the amount for caffeine in brewed coffee varies between different kinds of coffee beans as well as for different brewing methods. See this figure (from here):