The idea of a piece of paper being flat is an easy one for us to conceptualize since we perceive the world as having 3 spatial dimensions (i.e. a box can have length, width, and height). A piece of paper is roughly a 2-dimensional object (you seldom care about its thickness) but you can bend or fold it to take up more space in 3 dimensions–you could, for example, fold a piece of paper into a box.
From here it is necessary to develop an idea of curvature. The first thing necessary for this explanation is the notion of a straight line. This seems like a fairly obvious concept, but where we’re going we need a formal and rigid definition, which will be “the shortest distance between two points.” Next, let us look at what a triangle is; once again it seems like an obvious thing but we have to be very formal here: a triangle is “three points joined by straight lines where the points don’t lie on the same line.” The final tool I will be using is a little piece of Euclidean (i.e. “normal”) geometry: the sum of the angles on the inside of a triangle is 180 degrees. Euclidean geometry holds true for flat surfaces–any triangle you draw on a piece of paper will have that property.
Now let’s look at some curved surfaces and see what happens. For the sake of helping to wrap your mind around it we’ll stick with 2D surfaces in 3D space. One surface like this would be the surface of a sphere. Note that this is still a 2D surface because I can specify any point with only two numbers (say, latitude and longitude). For fun, let’s assume our sphere is the Earth.
What happens when we make a triangle on this surface? For simplicity I will choose my three points as the North Pole, the intersection of the Equator and the Prime Meridian (i.e. 0N, 0E), and a point on the equator 1/4 of the way around the planet (i.e. 0N, 90E). We make the “straight” lines connecting these points and find that they are the Equator, the Prime Meridian, and the line of longitude at 90E–other lines are not able to connect these three points by shorter distances. The real magic happens when you measure the angle at each of these points: it’s 90 degrees in each case (e.g. if you are standing at 0N 0E then you have to go north to get to one point or east to get to the other; that’s a 90 degree difference). The result is that if you sum the angles you get 270 degrees–you can see that the surface is not flat because Euclidean geometry is not maintained. You don’t have to use a triangle this big to show that the surface is curved, it’s just nice as an illustration.
So, you could imagine a society of people living on the surface of the earth and believing that the surface is flat. A flat surface provokes many questions–what’s under it, what’s at the edge, etc. They could come up with Euclidean geometry and then go out and start measuring large triangles and ultimately arrive at an inescapable conclusion: that the surface they’re living on is, in fact, curved (and, as it turns out, spherical). Note that they could measure the curvature of small regions, like a hill or a valley, and come up with a different result from the amount of curvature that the whole planet has. This poses the concept of local versus global/universal curvature.
That is not too far off from what we have done. Just as a 2D object like a piece of paper can be curved through 3D space, a 3-D object can be curved through 4-D space (don’t hurt your brain trying to visualize this). The curvature of a 3D object can be dealt with using the same mathematics as a curved 2D object. So we go out and we look at the universe and we take very precise measurements. We can see that locally space really is curved, which turns out to be a result of gravity. If you were to take three points around the sun and use them to construct a triangle then you would measure that the angles add up to slightly more than 180 degrees (note that light travels “in a straight line” according to our definition of straight. Light is affected by gravity, so if you tried to shine a laser from one point to another you have to aim slightly off of where the object is so that when the “gravity pulls”* the light it winds up hitting the target. *: gravity doesn’t actually pull–it’s literally just the light taking a straight path, but it looks like it was pulled).
What NASA scientists have done is they have looked at all of the data they can get their hands on to try to figure out whether the universe is flat or not, and if not they want to see whether it’s curved “up” or “down” (which is an additional discussion that I don’t have time to go into). The result of their observations is that the universe appears to be mostly flat–to within 0.4% margin. If the universe is indeed flat then that means we have a different set of questions that need answers than if they universe is curved. If it’s flat then you have to start asking “what’s outside of it, or why does ‘outside of it’ not make sense?” whereas if it’s curved you have to ask how big it is and why it is curved. Note that a curved universe acts very different from a flat universe in many cases–if you travel in one direction continuously in a flat universe then you always get farther and farther from your starting point, but if you do the same in a curved universe you wind up back where you started (think of it like traveling west on the earth or on a flat earth).
When you look at the results from the NASA scientists it turns out that the universe is very flat (although not necessarily perfectly flat), which means that if the universe is to be curved in on itself it is larger than the observable portion.