The Nurse is the one to tell the pair of their true identities. During the merriment of the ball, she spies Romeo kissing her charge. Knowing herself who Romeo is, she breaks them up by claiming, "Madam, your mother craves a word with you" (1.5.110). Romeo innocently inquires who the "lady of the house" is. When told, he is crestfallen. "Is she a Capulet? / O dear account. / My life is my foe's debt," he wails (1.5.115-116).
Alone with her Nurse, Juliet too wants to know her admirer's identity. When told, Juliet is heartbroken, exclaiming, "My only love sprung from my only hate. / Too early seen unknown, and known too late. / Prodigious birth of love it is to me / That I must love a loathed enemy" (1.5.137-140).
As to the ending, the audience knows going in that is a tragedy. What is interesting about the conclusion is the hand-holding, statue-building promises and cries of regret for past behavior. Will this moment of clarity be enough to truly revise generations of enmity? Perhaps. But pain fades, statues tarnish and become overgrown with weeds. The Prince's final words, I think, are meant more for the didactic lesson than any real hope of change for the feuding families. "Go hence to have more talk of these sad things," he directs, "Some shall be pardon'd, and some punished, / For never was a story of more woe, / than this of Juliet and her Romeo" (5.3.306-309)
One would think the Prologue of the play would give all the action in the play away and that the audience might as well not spend time reading the remainder since it tells us what will happen. However, being told what will happen and watching the body language and hearing the voice inflection of characters as they act out the play is completely different. In fact, one version directed by Director A will not be much like another version by any other Director. Each will have its own twist on events.
To answer your question, the dramatic effect of the ending is how the miscommunications bring Romeo, Paris, and Juliet into the Capulet tomb. Romeo all but begs Paris to leave him alone to his grief, but the also grieving Paris challenges Romeo until Paris is left dead on the floor. Romeo, left with Juliet, tenderly kisses her telling her how much he loves her. The audience, on the edge of its seat, is all but praying that Juliet will wake in time to save Romeo's life. Even though we already know the ending, we hope beyond hope that the two young lovers who have faced all this adversity will, indeed, prevail to ride off together into the sunset to our cheering. True to the story, he drinks the apothecary's poison and dies moments before Juliet awakes. We are sobbing with her, and then we are shocked at her violent and determined death. Therein lies the drama!