So there's this thing called continental drift, which means that the continents are always moving around.
Given enough time, and because the Earth is round (the Earth is round!), there comes a point when all the land masses on the face of the Earth run into each other. Eventually they drift away again, but for a while at least they form a giant glob called a supercontinent.
Pangea is the most recent supercontinent the Earth has had. It formed 300 million years ago and stayed that way for 100 million years before the land masses started drifting apart again.
Here is a picture of Pangea (source) as it was 300 million years ago, but with today's modern political boundaries drawn in:
Pretty cool. Really makes you think: what would it be like if the US bordered Morocco?