I am assuming this is your first observation of Rare Goods.
Rare Goods behave differently to ordinary trade commodities. They are highlighted in a different colour on the trade menu (in the default colour scheme, they are highlighted in yellow). They are only ever sold from one space station (although some, such as Onionhead, come in different "strains" that are available in different locations, each strain only has one source). They are very limited in how many you can buy; once you purchase your "quota", they won't sell you any more until you go away and sell what they've already sold you. Rare Goods are worth more credits, the farther you take them, up to a point; 160 LYs away is the maximum profit; beyond that range, you don't get any additional profit.
Back when the game first launched, Rare Goods Running was a popular and lucrative way of making credits quickly in a medium-sized ship. People wrote Rares Loops threads to find good routes and maximize efficiency; those old threads are still buried on the forum somewhere. It isn't worth doing in a larger ship (over 100 tonnes capacity) as "bulk trading" is more profitable and it's pretty much impossible to get more than 50 tonnes of Rares from any one place. And now, of course, there are easier ways to make money in smaller ships, so few people do Rares Running anymore. But it is a great way to "see the galaxy" and make profit at the same time (as opposed to just a-b-a-b trading or skimmer-spamming or whatever the latest goldrush is).
Be aware that the Onionhead strains are classified as "illegal drugs" and are therefore illicit commodities in most non-Anarchy systems. Not all Rare Goods are illegal. And the BGS does come into play as to whether or not a Rare Good is available; if a law-abiding faction takes over the station where you found that Onionhead, the Onionhead will no longer be sold there. The BGS states also have added a complication: Boom has more Rares available, Bust has fewer, and Lockdown shuts down the market. You can find the full list of Rare Goods and where to find them in
this thread, and
this thread has a list of currently blocked Rares.