Think of the game screen like a magical portal. The right edge of the screen is connected to the left edge, and the top edge is connected to the bottom edge.
If you fly off the Right side, you don't hit a wall or disappear forever. Instead, you instantly teleport to the Left side, maintaining your speed and direction.
In a game like Asteroids, we want the player to feel like they are floating in infinite space.
If we used walls: The ship would bounce or stop, which kills the feeling of drifting in open space.
If we didn't wrap: The player would fly off-screen and get lost in the darkness forever.
Wrapping creates an "Infinite Loop" on a single screen.