To organise my thinking on this I find it useful to consider the evolutionary development of existence from matter, to life, to mind, and the functional differences which have occured via these transitions. In this way we can contextualise and contrast what function emotions in general serve and why they would have arisen at all in the evolution of the universe.
The divisions made here, especially between life and mind, are not fully worked out, however are sufficient for this discussion. This first bit may seem unrelated to the question but I promise it’ll be tied together later.
Matter – is apparently mechanical/non-teleological. Does not involve negative feedback loops that seek to reach and maintain the state of a system within some defined parameters. Perturbations to the system therefore result in either minimal (system is robust) or significant transformation towards higher entropy (system is fragile). No ontological distinction between inside and outside exists. Associated with movement/directionless transformation.
Life – is teleological. Involves complex integrated negative feedback loops that seek to reach and maintain the state of a system within parameters appropriate for continued existence (maintenance of autopoiesis/self-reproduction across time) according to physiological feedback signals aka homoeostasis. Perturbations within some range can be adapted to and may even increase system adaptability (anti-fragile). Perturbations beyond specific ranges result in system-level breakdown of autopoiesis aka death. With the introduction of specified parameters for system maintenance, an inside and an outside is clearly established, the boundary indicated by that 2-dimensional surface beyond which perturbations prompt adaptive responses which seek to converge back to homoeostasis. Instinct (systems of homoeostatically organised movement that extend the will of the entity from inside to outside) and semiotics (systems of reference that enable adaptively approximate representation of outside to inside) emerge here.
Mind – is teleological. Involves complex integrated negative feedback loops that seek to reach and maintain state of a system within appropriate parameters for continued existence according to conditionally constructed mental models based on perceptual feedback interpreted through the lens of implicit belief systems about the meaning of stimuli. Perturbations to belief system within some range prompts adaptive modification of said system, beyond some range prompts destruction of belief system and indeterminate liminal chaos until an appropriate substitute can be found or constructed. The boundary that is introduced at the level of Life is both extended outwards and made more flexible, to include objects, spatial/territory, and other entities e.g. one’s children, family, peers, country etc. The boundaries can also exist around specific beliefs. The process of semiosis is extended from an a priori genetically encoded structure with limited definition and scope (eg predator, prey, food source, mate etc) into an arbitrarily expansive definition and scope (but still built on certain semiotic fundamentals which scaffold meaning), which can now include arbitrarily expanded theoretical context which informs the meaning of a given presented stimuli. There are contradictory optimisation directions which exist in the social life of many mentalised creatures, such as self-interest, offspring-interest, and group-interest, which can force more in-depth cognitive processing to seek as close to optimal solutions as are available within constraints of intelligence, time till decision is necessary etc. There are also contradictory optimisation directions implicated by consciousness of the time dimension (eg. consume resources now or save for later?). Emotions emerge as signals presented to consciousness to indicate relevant information or adaptively effective actions, in relation to these complex domains (as well as others which I wont explore here), and multiple signals may be presented at once, or summoned from memory/belief systems for further unification into a near-optimal conceptual (and thus behavioural) vector.
I think that mind emerged to mediate between conflicting vectors on the raw life/instinct layer, and that emotions signal specific motivational vectors/adaptive cues to consciousness, which then chooses between them (the difficulty (sometimes impossibility) of optimising the chosen solutions to these often contradictory options being a source of existential vertigo as well as ongoing complexification/refinement of the psyche’s belief, value and habit systems). Specific emotions in specific situations typically come attached with implicit beliefs about how that situation is likely to play out, with the interpretation of the experienced situation modulating which emotions arise and to what level of intensity. The interpretations are typically conditioned by past exposure to similar situations that were interpreted in similar ways, with functionality varied by whether they have been properly digested (relativised, constrained by contextualised perception and other motivations, therefore regulated and balanced (balanced = maintains balance between contradictory motivational vectors)) or not (infinitised, not constrained by contextualised perception and other motives, therefore imbalanced (imbalanced = balance between contradictory motivational vectors breaks down such that one gains predominance and all others become irrelevant for the period of imbalance)). The experience of emotion may be unnecessary at the level of instinct because there is no gap between stimulus and response – the stimulus signal is interpreted unambiguously and the motivational vectors are defined singularly with respect to each specific stressor, therefore the appropriately adaptive response from the organism is clear. However it seems likely that qualia still exist in these creatures, perhaps some kind of proto-emotional qualia. In relatively simple organisms, there is therefore a very straightforward reaction between stimulus and response, and likely does not involve emotion as we experience it, and certainly does not involve emotion in terms of how it operates functionally in certain more complex organisms.
A key aspect of this difference is that instinct plays out automatically and is de-centralised, while emotions are signals and motivational vectors presented to a centralised consciousness. They carry non-linearly/parallel processed information from multiple streams, physiological, memory, interpretative, to summarise schemas of specific forms of relevance to consciousness, for further deliberation, examination, and ultimately choice for if, why and how to act. I think of them as altering the shape of the probability matrix of interpretative(conceptual)- and decision(values)-space. When the probability matrix hits 1 in a certain zone, and 0 in all others, a specific conclusion is reached or action is taken. When the probability matrix remains with distributed non-zero+non-one values, or with a singular spike but with sufficient detachment, one can still think about a situation clearly (thinking stops when conclusion is attained), while being able to take the data and impulse from the emotion/s into consideration. At the level of pure instinct, the probability matrix always reads 1 in a singular zone, because there is no nuance or flexibility in the interpretation of the stimulus (no thought involved), and no ambiguity or conflict between task demands. At the level of mind, the probability matrix is capable of being suspended at non-zero+non-one values across its whole scope, while also receiving influence from the instinctual layer, which becomes experienced as emotion at the level of consciousness. In this way, nuance of interpretation and action become possible, as novel vectors that synthesise emotion vectors into balanced perspectives and actionable plans become possible. Distance from immediate discharge of instinct opens up the space within which the flexibility of mental processing can occur. The primary utilities of this capacity to relativise and balance different emotional-motivational inputs to refine behavioural output are the regulation of behaviour in a social context - historically extremely important, in social mammalian hierarchies, a matter of life and death - as well as regulation of ones activity across multiple time-spans, also potentially a matter of life and death. Therefore evolutionary selection pressures selected for the generation and development of this mental layer which enables a creative and adaptive tension between thought and emotion to exist and guide organisms towards more effective survival and replication strategies.
Somewhat of a side note; In this understanding of emotions, we go beyond the ontology of fragmented materiality or mere computation/algorithmicity, wherein forces propagate through systems of interrelated parts but there is no ontological relationship of parts to wholes, only a functional relationship between parts. In the relation between emotion and consciousness, we have an ontological relationship between parts and the whole, wherein the whole is not composed of parts per se (phenomenologically speaking) but is the basic condition for the operation of any ‘parts’ within it. Consciousness/subjectivity is apparently a necessary mediator of this process, for some unknown reason. We can infer that consciousness is necessary for this, and that the apparatus of emotion evolved within conscious agents to enhance capacity to deal with the problems posed by evolutionary selection pressures, due to the fact that evolution is a highly conservative process, so takes the path of least resistance (given some degree of constraints of path-dependence), and that conscious operations are quite energy intensive. It would be interesting to speculate about ‘why?’ since, if it was possible to replicate the functions of emotion in an unconscious algorithm-like instinct-response system, it would have been done. Why has it not been done? This I think leads into questions of ontology, and the question of the fundamental difference between minds and machines. I do not have a sufficient ontology to map the relations that exist here, but it is clear that emotion and its processes go beyond mere mechanism, mediated in some fundamental way by consciousness, while retaining a functional utility within the context of mind, organism, and survival.