Most spontaneous tempo runs shouldn't be "hard," at least not for very long. One of the main benefits of these on-the-fly tempo runs is that they can be simultaneously fast and relatively effort-free. Let's not lose sight of the fact that the goal of improving running performances isn't to run hard; it's to run fast. Running at your limit obviously involves running hard, but making improvements in your ability to efficiently convert stored energy to forward velocity (a.k.a. running economy) is normally maximized by cultivating the ability to relax and maintain effort-saving movements while running fast. Properly relaxed "tempo" running, while it can be done at many different speeds and still remain below a "threshold" of distress (speed and duration of effort being generally inversely related in this equation), affords the opportunity to accumulate more time in an economical state than if the effort produced distress, either orthopedically or metabolically. And more time spent means a broader stimulus for adaptation, as long as (and particularly if) the same state of effort can be reproduced frequently without those orthopedic or metabolic breakdowns resulting.
Some of the adaptations that occur in this sport, particularly in relation to running economy, are either entirely neurological or are intimately tied to neurological signals during effort. For example, in a sustained effort, invoking the fewest motor units (and, normally, those with the lowest threshold for activation) which can accomplish the job is the most effective m.o. and will result in the least squandered energy, the least orthopedic stress, and the most time amassed at that pace. Optimal stride frequency for sustained running varies slightly between individuals based on skeletal structure, muscle fiber composition, muscle mass distribution, etc., but as a general rule (and up to a point normally between 180 and 185 steps per minute for most competitive runners), a faster stride cadence with a lower power generation is more economical at a given steady pace, due to the minimization of vertical oscillation (which is not only wasteful as a result of prolonged "hang time," but often creates unnecessary shock on impact during the plant phase), due to reducing the time spent bending and unbending joints within the plant phase, and due to the involvement of more motor units which can contribute to fine motor control (which also minimizes wobbling and contributes to more stable footstrikes). Correct relaxed tempo running gives you the chance to habitually ingrain and reinforce efficient stride patterns and motor unit recruitment for durations sufficient to produce noticeable adaptations. Struggling and fighting the pace not only hinders the efficient selection of motor units; it reduces the amount of time spent at pace, prolongs recovery time, and effectively dampens the stimulus for adaptation.
Those time trials are what most people think of as tempo runs and what you mean by "running hard for an extended period of time" - the effort is more focused on a certain pace and you're consciously pushing a bit more (and perhaps for a little longer) rather than enjoying the ride for most of the run. Even in these harder efforts, the duration (and peak intensity) of the hard running should be managed so relaxation can be preserved as much as possible as the different energy pathways (such as the lactate system) begin to come more into play as the pace quickens.