Can refer to something that is literally smelly or metaphorically undesirable.
El aire apestado en esa zona hacía difícil respirar cómodamente.
The stinking air in that area made it hard to breathe comfortably.
El olor apestado de la basura hizo que todos quisieran salir de la casa rápidamente.
The stinking smell of the garbage made everyone want to leave the house quickly.