How does identifying the speaker and the occasion of the poem reveal the dramatic quality of the poem?
Certainly, the structure of a poem, such as a sonnet, an ode, or an elegy, contributes to its dramatic effect. Then, the occasion of the poem and the tone of the speaker contributes to the dramatic effect. In Thomas Gray's "Elegy in a Country Churchyard," for instance, there is the sobering tone of the Latin motif of momento mori, "Remember that you must die." And, as the speaker traverses the graveyard and reads the unknown names on the markers, he reflects that the lives of these country people may have been impeded from greatness simply because of their humble stations in life. He also realizes that now they are the equal of any, as all humans reach the same end. In fact, there are, perhaps, more noble because they never compromised their values in order to achieve greatness:
Far from the madding crowd's ignoble strife/Their sober wishes never learned to stray/Along the cool, sequestered vale of life/They kept the noiseless tenor of their way.
Indeed, the structure of Gray's poem lends dramatic qualities to the lines, and the tone of this poem reinforces these qualities.
Identifying the speaker and the occasion in the poem seems to me much like putting the poem on the stage, with an actor and a setting. This strategy turns printed words into public performance (at least in a figurative sense).
This strategy highlights the dramatic quality of at least some poetry, but there is a great deal of poetry (especially lyric poetry) that would be difficult to read as dramatic. The speaker and occasion are not always clearly defined or developed in a poem, and the reader would probably be forced to invent most of the details about the speaker and the occasion in order to read some poems in this manner.
Drama is all about a kind of dialogue between speakers. At bottom, it is literature as in the spoken words of characters. In a poem too, there is a speaking voice, which is generally called a 'persona'. His/Hers is the dominant perspective in the poem. Now identifying that voice means to ground it in a concrete situation that adds to the drama of it. There has been a great tradition of 'dramatic monologue' in English poetry from Donne to Browning and onwards. In such a poem, we have a speaker and an articulated presence of a silent listener. In recent times 'performance-poetry' has really come off age on stage especially in post-colonial countries like Africa and Australia and so on. These are mostly occasional pieces and a disclosure of the specific occasion of such a poem definitely unfurls its performative aspect and thus establishes its dramatic quality.