Probably Stolen: Stolen goods and inspections
Separate three questions: is the item stolen, is it contraband, and how likely is it to be recognized? Heat, contraband tier, reputation and current events all matter, but no verified probability formula is available.

In-game reference
Mentor's Note: Stolen Items
It is illegal to trade in [Stolen] items. Each stolen item has Heat value, the higher the Heat, the more likely Security will recognize it on inspection. Sellers will offer a discount based on the Heat value. Heat slowly decreases over time.
Mentor's Note: Contraband
Contraband includes any item that is considered illegal by the Republic. The possession or sale of Contraband carries a high risk... and a higher profit margin. There are 4 tiers of Contraband: Low Level (+value shown in your game% Profit Margin): While technically illegal, they are generally ignored by Security unless they are out to get you. Mid Level (+value shown in your game% Profit Margin): If found during Inspection, this item will be seized. High Level (+value shown in your game% Profit Margin): If found during Inspection, this item will be seized and you will receive a fine. Critical Level (+value shown in your game% Profit Margin): If found during Inspection, the Store will be shut down permanently and you will be immediately arrested. Additionally, you will lose Reputation with Security if any Contraband is found.
Mentor's Note: Security Inspection
Station Security will conduct random inspections for Contraband. Your Reputation with Security will affect the severity of your punishment when Contraband is found. Events can affect how often the Store is inspected. Additionally, different Officers will conduct inspections differently. Some may be open to a bribe; others may not search every container.

Official game analysis
Names and rules follow the in-game reference material. Availability, prices and unlocks can change; your current game takes precedence. These are reference tools, not a live connection to your save.
Official demo page