It is an olfactory hallucination that makes you smell odors that are not actually present in your surrounding.
Usually, odors are unpleasant smells such as feces, rotting flesh, vomit, smoke, etc.
It occurs due to damage to nervous tissue in the olfactory system, this damage could be due to trauma, surgery, viral infection, and potentially exposure to drugs or toxins.
It can also occur due to epilepsy because epilepsy affects the olfactory cortex