Both poems talk about loving a special someone, but not being able to be together. Marvell blames Fate for keeping him away from his love, while Donne liberally believes that each person's journey through life may separate them for a time. However, Marvell feels trapped by fate as he compares himself and his love to being a part of an iron gate that separates them. He bemoans this fact in the following stanza:
As Lines so Loves Oblique may well
Themselves in every Angle greet:
But ours so truly Parallel,
Though infinite can never meet.
He's saying that even though they see each other, they can never be together completely because of what separates them (i.e. metaphorical gate.)
But Donne, on the other hand, seems to look at this separation from his love as a positive thing as stated in the following stanza:
And though it in the centre sit,
Yet when the other far doth roam,
It leans, and hearkens after it,
And grows erect, as that comes home.
Donne seems to be echoing Shakespeare when Will said that "absence makes the heart grow fonder." Clearly, there are two similar situations about which each poet wrote, but the attitude towards the situation is different.