Caffeine is in the chemical group of alkaloids called xanthines, which are derivatives of xanthine. Xanthine (and therefore the xanthines) has a nitrogenous base, meaning it is structured with at least one nitrogen atom as its base.
Caffeine, DNA, and RNA are all types of purines, molecules that have a nitrogenous base and ring-like structure connecting two or more unique elements. Due to this, humans have an abundance of receptor cells specifically for different types of purines. Caffeine is often used directly as a stimulant due to its effects on the nervous system and mental state, as well as being an ingredient in many pharmacological and food products.