An opponent in dreams, from a spiritual perspective, is that part of us that is not co-operating in the grand scheme of things and is, therefore, introducing an element of negativity.
It is also, as we become more aware, negative elements, which we may be required to confront and overcome, or at worst understand, before there can be progress.
Psychological / emotional perspective: When we find ourselves opposed to someone in dreams, we often have some kind of emotional difficulty, which prevents us from understanding a conflict within ourselves. Once identified, we are able to resolve our problem in waking life.
In mundane terms, any conflict in waking life could manifest as a personalized opponent or as opposition in dreams. How that opponent presents itself will often give us the information we need to deal with the problem.
For instance, an imp as an opponent might mean that we will have to deal with minor irritations first.